Merge #12427: Make signrawtransaction accept P2SH-P2WSH redeemscripts
5f605e1
Make signrawtransaction accept P2SH-P2WSH redeemscripts (Pieter Wuille)
Pull request description:
This is a quick fix for #12418, which is a regression in 0.16.
It permits specifying just the inner redeemscript to let `signrawtransaction` succeed. This inner redeemscript is already reported by `addmultisigaddress` & co.
#11708 uses a different approach, where `listunspent` reports both inner & outer redeemscript, but requires both to be provided to `signrawtransaction`. Part of #11708 is still needed even in combination with this PR however, as currently the inner redeemscript isn't reported by `listunspent`.
Tree-SHA512: a6fa2b2661ce04db25cf029dd31da39c0b4811d43692f816dfe0f77b4159b5e2952051664356a579f690ccd58a626e0975708afcd7ad5919366c490944e3a9a5
This commit is contained in:
commit
3fa556aee2
1 changed files with 2 additions and 0 deletions
|
@ -848,6 +848,8 @@ UniValue signrawtransaction(const JSONRPCRequest& request)
|
||||||
std::vector<unsigned char> rsData(ParseHexV(v, "redeemScript"));
|
std::vector<unsigned char> rsData(ParseHexV(v, "redeemScript"));
|
||||||
CScript redeemScript(rsData.begin(), rsData.end());
|
CScript redeemScript(rsData.begin(), rsData.end());
|
||||||
tempKeystore.AddCScript(redeemScript);
|
tempKeystore.AddCScript(redeemScript);
|
||||||
|
// Automatically also add the P2WSH wrapped version of the script (to deal with P2SH-P2WSH).
|
||||||
|
tempKeystore.AddCScript(GetScriptForWitness(redeemScript));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue