mirror of
https://github.com/ElementsProject/elements.git
synced 2026-08-15 12:51:00 +02:00
Implicitly know about P2WPKH redeemscripts
Make CKeyStore automatically known about the redeemscripts necessary for P2SH-P2WPKH (and due to the extra checks in IsMine, also P2WPKH) spending.
This commit is contained in:
parent
57273f2b30
commit
f37c64e477
6 changed files with 58 additions and 25 deletions
|
|
@ -508,12 +508,7 @@ BOOST_AUTO_TEST_CASE(script_standard_IsMine)
|
|||
scriptPubKey.clear();
|
||||
scriptPubKey << OP_0 << ToByteVector(pubkeys[0].GetID());
|
||||
|
||||
// Keystore has key, but no P2SH redeemScript
|
||||
result = IsMine(keystore, scriptPubKey, isInvalid);
|
||||
BOOST_CHECK_EQUAL(result, ISMINE_NO);
|
||||
BOOST_CHECK(!isInvalid);
|
||||
|
||||
// Keystore has key and P2SH redeemScript
|
||||
// Keystore implicitly has key and P2SH redeemScript
|
||||
keystore.AddCScript(scriptPubKey);
|
||||
result = IsMine(keystore, scriptPubKey, isInvalid);
|
||||
BOOST_CHECK_EQUAL(result, ISMINE_SPENDABLE);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue