Browse Source

Make signrawtransaction accept P2SH-P2WSH redeemscripts

Github-Pull: #12427
Rebased-From: 5f605e172baee35421eb20736601befdd8cad796
Tree-SHA512: caf8c4e1806757d705493de30eea4f6a146a334ca6f6c93bc74cda43abda391b8406dd8ed6765fcde8eb86b3fb55689547ab69a30f34fca0d7896ea8c4e1db67
0.16
Pieter Wuille 7 years ago committed by Wladimir J. van der Laan
parent
commit
3762ac127a
No known key found for this signature in database
GPG Key ID: 1E4AED62986CD25D
  1. 2
      src/rpc/rawtransaction.cpp

2
src/rpc/rawtransaction.cpp

@ -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…
Cancel
Save