Make signrawtransaction accept P2SH-P2WSH redeemscripts

Github-Pull: #12427
Rebased-From: 5f605e172baee35421eb20736601befdd8cad796
Tree-SHA512: caf8c4e1806757d705493de30eea4f6a146a334ca6f6c93bc74cda43abda391b8406dd8ed6765fcde8eb86b3fb55689547ab69a30f34fca0d7896ea8c4e1db67
This commit is contained in:
Pieter Wuille 2018-02-13 13:04:48 -08:00 committed by Wladimir J. van der Laan
parent ad10b90e50
commit 3762ac127a
No known key found for this signature in database
GPG Key ID: 1E4AED62986CD25D

View File

@ -848,6 +848,8 @@ UniValue signrawtransaction(const JSONRPCRequest& request)
std::vector<unsigned char> rsData(ParseHexV(v, "redeemScript"));
CScript redeemScript(rsData.begin(), rsData.end());
tempKeystore.AddCScript(redeemScript);
// Automatically also add the P2WSH wrapped version of the script (to deal with P2SH-P2WSH).
tempKeystore.AddCScript(GetScriptForWitness(redeemScript));
}
}
}