Skip to content

Commit 3fa556a

Browse files
committed
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
2 parents 5eff1c7 + 5f605e1 commit 3fa556a

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

src/rpc/rawtransaction.cpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -848,6 +848,8 @@ UniValue signrawtransaction(const JSONRPCRequest& request)
848848
std::vector<unsigned char> rsData(ParseHexV(v, "redeemScript"));
849849
CScript redeemScript(rsData.begin(), rsData.end());
850850
tempKeystore.AddCScript(redeemScript);
851+
// Automatically also add the P2WSH wrapped version of the script (to deal with P2SH-P2WSH).
852+
tempKeystore.AddCScript(GetScriptForWitness(redeemScript));
851853
}
852854
}
853855
}

0 commit comments

Comments
 (0)