Skip to content

Commit 5f605e1

Browse files
committed
Make signrawtransaction accept P2SH-P2WSH redeemscripts
1 parent 252ae71 commit 5f605e1

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)