diff options
| author | Pieter Wuille <[email protected]> | 2018-06-17 19:44:50 -0700 |
|---|---|---|
| committer | Pieter Wuille <[email protected]> | 2018-06-17 19:44:50 -0700 |
| commit | bb582a59c7532b0e4f647d9dfe50f0d816e81427 (patch) | |
| tree | 4961859632aa54894a57b87cdde4af6e2bb08c86 /src/rpc | |
| parent | Add additional unit tests for invalid IsMine combinations (diff) | |
| download | discoin-bb582a59c7532b0e4f647d9dfe50f0d816e81427.tar.xz discoin-bb582a59c7532b0e4f647d9dfe50f0d816e81427.zip | |
Add P2WSH destination helper and use it instead of manual hashing
Diffstat (limited to 'src/rpc')
| -rw-r--r-- | src/rpc/rawtransaction.cpp | 4 |
1 files changed, 1 insertions, 3 deletions
diff --git a/src/rpc/rawtransaction.cpp b/src/rpc/rawtransaction.cpp index 3b3f43ede..e7531734d 100644 --- a/src/rpc/rawtransaction.cpp +++ b/src/rpc/rawtransaction.cpp @@ -637,9 +637,7 @@ static UniValue decodescript(const JSONRPCRequest& request) } else { // Scripts that are not fit for P2WPKH are encoded as P2WSH. // Newer segwit program versions should be considered when then become available. - uint256 scriptHash; - CSHA256().Write(script.data(), script.size()).Finalize(scriptHash.begin()); - segwitScr = GetScriptForDestination(WitnessV0ScriptHash(scriptHash)); + segwitScr = GetScriptForDestination(WitnessV0ScriptHash(script)); } ScriptPubKeyToUniv(segwitScr, sr, true); sr.pushKV("p2sh-segwit", EncodeDestination(CScriptID(segwitScr))); |