Currently signrawtransaction
works with P2SH-P2WSH which are already in wallet (e.g. addmultisigaddress
-> addwitnessaddress
). But when using signrawtransaction with keys which aren’t in the wallet, there is currently only a redeemScript
key so you cannot enter both the P2SH redeemScript and the witness script. There is an undocumented workaround by including the same input twice (suggested on StackExchange here), once with each script, but that is unnecessary and hacky.
This simply allows the optional inclusion of a witnessScript key in the JSON input to signrawtransaction
. Because it uses JSON, this is a non-breaking change.
Also, as discussed on IRC (see here), we add a witnessScript
output to the listunspent RPC for P2SH-P2WSH addresses because gmaxwell pointed out signrawtransaction should be able to get most of the needed info from listunspent.
Closes #11693
TODO:
- ~Needs tests + release notes~