![]() |
Bitcoin Core
0.21.1
P2P Digital Currency
|
#include <script/sign.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< unsigned char > | 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< unsigned char > &sig_out, const CPubKey &pubkey, const CScript &scriptcode, SigVersion sigversion) |
| static bool | SignStep (const SigningProvider &provider, const BaseSignatureCreator &creator, const CScript &scriptPubKey, std::vector< valtype > &ret, TxoutType &whichTypeRet, SigVersion sigversion, SignatureData &sigdata) |
| Sign scriptPubKey using signature made with creator. More... | |
| 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. More... | |
| SignatureData | DataFromTransaction (const CMutableTransaction &tx, unsigned int nIn, const CTxOut &txout) |
| Extract signature data from a transaction input, and insert it. More... | |
| void | UpdateInput (CTxIn &input, const SignatureData &data) |
| bool | SignSignature (const SigningProvider &provider, const CScript &fromPubKey, CMutableTransaction &txTo, unsigned int nIn, const CAmount &amount, int nHashType) |
| Produce a script signature for a transaction. More... | |
| bool | SignSignature (const SigningProvider &provider, const CTransaction &txFrom, CMutableTransaction &txTo, unsigned int nIn, int nHashType) |
| bool | IsSolvable (const SigningProvider &provider, const CScript &script) |
| bool | IsSegWitOutput (const SigningProvider &provider, const CScript &script) |
| Check whether a scriptPubKey is known to be segwit. More... | |
| bool | SignTransaction (CMutableTransaction &mtx, const SigningProvider *keystore, const std::map< COutPoint, Coin > &coins, int nHashType, std::map< int, std::string > &input_errors) |
| Sign the CMutableTransaction. More... | |
Variables | |
| const BaseSignatureCreator & | DUMMY_SIGNATURE_CREATOR = DummySignatureCreator(32, 32) |
| A signature creator that just produces 71-byte empty signatures. More... | |
| const BaseSignatureCreator & | DUMMY_MAXIMUM_SIGNATURE_CREATOR = DummySignatureCreator(33, 32) |
| A signature creator that just produces 72-byte empty signatures. More... | |
|
static |
| SignatureData DataFromTransaction | ( | const CMutableTransaction & | tx, |
| unsigned int | nIn, | ||
| const CTxOut & | txout | ||
| ) |
|
static |
|
static |
| bool IsSegWitOutput | ( | const SigningProvider & | provider, |
| const CScript & | script | ||
| ) |
| bool IsSolvable | ( | const SigningProvider & | provider, |
| const CScript & | script | ||
| ) |
| bool ProduceSignature | ( | const SigningProvider & | provider, |
| const BaseSignatureCreator & | creator, | ||
| const CScript & | scriptPubKey, | ||
| SignatureData & | sigdata | ||
| ) |
| bool SignSignature | ( | const SigningProvider & | provider, |
| const CScript & | fromPubKey, | ||
| CMutableTransaction & | txTo, | ||
| unsigned int | nIn, | ||
| const CAmount & | amount, | ||
| int | nHashType | ||
| ) |
| bool SignSignature | ( | const SigningProvider & | provider, |
| const CTransaction & | txFrom, | ||
| CMutableTransaction & | txTo, | ||
| unsigned int | nIn, | ||
| int | nHashType | ||
| ) |
|
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 98 of file sign.cpp.
| bool SignTransaction | ( | CMutableTransaction & | mtx, |
| const SigningProvider * | keystore, | ||
| const std::map< COutPoint, Coin > & | coins, | ||
| int | nHashType, | ||
| std::map< int, std::string > & | input_errors | ||
| ) |
Sign the CMutableTransaction.
Definition at line 472 of file sign.cpp.
| void UpdateInput | ( | CTxIn & | input, |
| const SignatureData & | data | ||
| ) |
| const BaseSignatureCreator& DUMMY_MAXIMUM_SIGNATURE_CREATOR = DummySignatureCreator(33, 32) |
| const BaseSignatureCreator& DUMMY_SIGNATURE_CREATOR = DummySignatureCreator(32, 32) |
1.8.8