mirror of
https://github.com/bitcoin/bitcoin.git
synced 2026-03-31 10:56:03 +02:00
Calculate and store the number of bytes required to spend an input
This commit is contained in:
@@ -194,11 +194,16 @@ SignatureData DataFromTransaction(const CMutableTransaction& tx, unsigned int nI
|
||||
return data;
|
||||
}
|
||||
|
||||
void UpdateInput(CTxIn& input, const SignatureData& data)
|
||||
{
|
||||
input.scriptSig = data.scriptSig;
|
||||
input.scriptWitness = data.scriptWitness;
|
||||
}
|
||||
|
||||
void UpdateTransaction(CMutableTransaction& tx, unsigned int nIn, const SignatureData& data)
|
||||
{
|
||||
assert(tx.vin.size() > nIn);
|
||||
tx.vin[nIn].scriptSig = data.scriptSig;
|
||||
tx.vin[nIn].scriptWitness = data.scriptWitness;
|
||||
UpdateInput(tx.vin[nIn], data);
|
||||
}
|
||||
|
||||
bool SignSignature(const CKeyStore &keystore, const CScript& fromPubKey, CMutableTransaction& txTo, unsigned int nIn, const CAmount& amount, int nHashType)
|
||||
|
||||
@@ -80,6 +80,7 @@ SignatureData CombineSignatures(const CScript& scriptPubKey, const BaseSignature
|
||||
/** Extract signature data from a transaction, and insert it. */
|
||||
SignatureData DataFromTransaction(const CMutableTransaction& tx, unsigned int nIn);
|
||||
void UpdateTransaction(CMutableTransaction& tx, unsigned int nIn, const SignatureData& data);
|
||||
void UpdateInput(CTxIn& input, const SignatureData& data);
|
||||
|
||||
/* 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
|
||||
|
||||
Reference in New Issue
Block a user