mirror of
https://github.com/bitcoin/bitcoin.git
synced 2025-11-11 22:50:59 +01:00
script/sign: signing support for Miniscripts with hash preimage challenges
Preimages must be externally provided (typically, via a PSBT).
This commit is contained in:
@@ -435,7 +435,8 @@ static void CreateCreditAndSpend(const FillableSigningProvider& keystore, const
|
||||
inputm.vout.resize(1);
|
||||
inputm.vout[0].nValue = 1;
|
||||
inputm.vout[0].scriptPubKey = CScript();
|
||||
bool ret = SignSignature(keystore, *output, inputm, 0, SIGHASH_ALL);
|
||||
SignatureData empty;
|
||||
bool ret = SignSignature(keystore, *output, inputm, 0, SIGHASH_ALL, empty);
|
||||
assert(ret == success);
|
||||
CDataStream ssin(SER_NETWORK, PROTOCOL_VERSION);
|
||||
ssin << inputm;
|
||||
@@ -519,7 +520,8 @@ BOOST_AUTO_TEST_CASE(test_big_witness_transaction)
|
||||
|
||||
// sign all inputs
|
||||
for(uint32_t i = 0; i < mtx.vin.size(); i++) {
|
||||
bool hashSigned = SignSignature(keystore, scriptPubKey, mtx, i, 1000, sigHashes.at(i % sigHashes.size()));
|
||||
SignatureData empty;
|
||||
bool hashSigned = SignSignature(keystore, scriptPubKey, mtx, i, 1000, sigHashes.at(i % sigHashes.size()), empty);
|
||||
assert(hashSigned);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user