Browse Source

Make signrawtransaction accept P2SH-P2WSH redeemscripts

Github-Pull: #12427
Rebased-From: 5f605e172b
Tree-SHA512: caf8c4e1806757d705493de30eea4f6a146a334ca6f6c93bc74cda43abda391b8406dd8ed6765fcde8eb86b3fb55689547ab69a30f34fca0d7896ea8c4e1db67
tags/v0.16.1
Pieter Wuille 2 years ago
parent
commit
3762ac127a
No account linked to committer's email address
1 changed files with 2 additions and 0 deletions
  1. 2
    0
      src/rpc/rawtransaction.cpp

+ 2
- 0
src/rpc/rawtransaction.cpp 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));
}
}
}

Loading…
Cancel
Save