Bitcoin ABC 0.26.3
P2P Digital Currency
|
#include <script/sign.h>
#include <consensus/amount.h>
#include <key.h>
#include <policy/policy.h>
#include <primitives/transaction.h>
#include <script/signingprovider.h>
#include <script/standard.h>
#include <uint256.h>
Go to the source code of this file.
Typedefs | |
typedef std::vector< uint8_t > | valtype |
Functions | |
static bool | GetCScript (const SigningProvider &provider, const SignatureData &sigdata, const CScriptID &scriptid, CScript &script) |
static bool | GetPubKey (const SigningProvider &provider, const SignatureData &sigdata, const CKeyID &address, CPubKey &pubkey) |
static bool | CreateSig (const BaseSignatureCreator &creator, SignatureData &sigdata, const SigningProvider &provider, std::vector< uint8_t > &sig_out, const CPubKey &pubkey, const CScript &scriptcode) |
static bool | SignStep (const SigningProvider &provider, const BaseSignatureCreator &creator, const CScript &scriptPubKey, std::vector< valtype > &ret, TxoutType &whichTypeRet, SignatureData &sigdata) |
Sign scriptPubKey using signature made with creator. | |
static CScript | PushAll (const std::vector< valtype > &values) |
bool | ProduceSignature (const SigningProvider &provider, const BaseSignatureCreator &creator, const CScript &fromPubKey, SignatureData &sigdata) |
Produce a script signature using a generic signature creator. | |
SignatureData | DataFromTransaction (const CMutableTransaction &tx, unsigned int nIn, const CTxOut &txout) |
Extract signature data from a transaction input, and insert it. | |
void | UpdateInput (CTxIn &input, const SignatureData &data) |
bool | SignSignature (const SigningProvider &provider, const CScript &fromPubKey, CMutableTransaction &txTo, unsigned int nIn, const Amount amount, SigHashType sigHashType) |
Produce a script signature for a transaction. | |
bool | SignSignature (const SigningProvider &provider, const CTransaction &txFrom, CMutableTransaction &txTo, unsigned int nIn, SigHashType sigHashType) |
bool | IsSolvable (const SigningProvider &provider, const CScript &script) |
Check whether we know how to sign for an output like this, assuming we have all private keys. | |
bool | SignTransaction (CMutableTransaction &mtx, const SigningProvider *keystore, const std::map< COutPoint, Coin > &coins, SigHashType sigHashType, std::map< int, std::string > &input_errors) |
Sign the CMutableTransaction. | |
Variables | |
const BaseSignatureCreator & | DUMMY_SIGNATURE_CREATOR |
A signature creator that just produces 71-byte empty signatures. | |
const BaseSignatureCreator & | DUMMY_MAXIMUM_SIGNATURE_CREATOR |
A signature creator that just produces 72-byte empty signatures. | |
|
static |
SignatureData DataFromTransaction | ( | const CMutableTransaction & | tx, |
unsigned int | nIn, | ||
const CTxOut & | txout | ||
) |
|
static |
|
static |
bool IsSolvable | ( | const SigningProvider & | provider, |
const CScript & | script | ||
) |
Check whether we know how to sign for an output like this, assuming we have all private keys.
While this function does not need private keys, the passed keystore is used to look up public keys and redeemscripts by hash. Solvability is unrelated to whether we consider this output to be ours.
Definition at line 424 of file sign.cpp.
bool ProduceSignature | ( | const SigningProvider & | provider, |
const BaseSignatureCreator & | creator, | ||
const CScript & | fromPubKey, | ||
SignatureData & | sigdata | ||
) |
|
static |
bool SignSignature | ( | const SigningProvider & | provider, |
const CScript & | fromPubKey, | ||
CMutableTransaction & | txTo, | ||
unsigned int | nIn, | ||
const Amount | amount, | ||
SigHashType | sigHashType | ||
) |
bool SignSignature | ( | const SigningProvider & | provider, |
const CTransaction & | txFrom, | ||
CMutableTransaction & | txTo, | ||
unsigned int | nIn, | ||
SigHashType | sigHashType | ||
) |
|
static |
Sign scriptPubKey using signature made with creator.
Signatures are returned in scriptSigRet (or returns false if scriptPubKey can't be signed), unless whichTypeRet is TxoutType::SCRIPTHASH, in which case scriptSigRet is the redemption script. Returns false if scriptPubKey could not be completely satisfied.
Definition at line 106 of file sign.cpp.
bool SignTransaction | ( | CMutableTransaction & | mtx, |
const SigningProvider * | keystore, | ||
const std::map< COutPoint, Coin > & | coins, | ||
SigHashType | sigHashType, | ||
std::map< int, std::string > & | input_errors | ||
) |
Sign the CMutableTransaction.
Definition at line 441 of file sign.cpp.
void UpdateInput | ( | CTxIn & | input, |
const SignatureData & | data | ||
) |
const BaseSignatureCreator& DUMMY_MAXIMUM_SIGNATURE_CREATOR |
const BaseSignatureCreator& DUMMY_SIGNATURE_CREATOR |