diff options
author | MarcoFalke <*~=`'#}+{/-|&$^_@721217.xyz> | 2023-01-30 09:48:33 +0100 |
---|---|---|
committer | MarcoFalke <*~=`'#}+{/-|&$^_@721217.xyz> | 2023-01-30 09:49:01 +0100 |
commit | 1c8b80f440ae70645c10b7ae517c9abb1ba82a8b (patch) | |
tree | eb28525acadb292a522ff27be09eef0ec3afa9f9 /src/wallet/rpc/coins.cpp | |
parent | 114c5eca77fc3d4b4af812358ed471e7e5166e9d (diff) | |
parent | 6879be691bf636a53208ef058f2ebe18bfa8017c (diff) | |
download | bitcoin-1c8b80f440ae70645c10b7ae517c9abb1ba82a8b.tar.xz |
Merge bitcoin/bitcoin#15294: refactor: Extract RipeMd160
6879be691bf636a53208ef058f2ebe18bfa8017c refactor: Extract RIPEMD160 (Ben Woosley)
Pull request description:
To directly return a CRIPEMD160 hash from data.
Simplifies the call sites.
ACKs for top commit:
achow101:
ACK 6879be691bf636a53208ef058f2ebe18bfa8017c
theStack:
re-ACK 6879be691bf636a53208ef058f2ebe18bfa8017c
MarcoFalke:
review ACK 6879be691bf636a53208ef058f2ebe18bfa8017c 🏔
Tree-SHA512: 6ead85d8060c2ac6afd43ec716ff5a82d6754c4132fe7df3b898541fa19f1dfd8b301b2b66ae7cb7594b1b1a8c7f68bce3790a8c610d4a1164e995d89bc5ae34
Diffstat (limited to 'src/wallet/rpc/coins.cpp')
-rw-r--r-- | src/wallet/rpc/coins.cpp | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/src/wallet/rpc/coins.cpp b/src/wallet/rpc/coins.cpp index 32151d5b5c..4c386789f1 100644 --- a/src/wallet/rpc/coins.cpp +++ b/src/wallet/rpc/coins.cpp @@ -3,6 +3,7 @@ // file COPYING or http://www.opensource.org/licenses/mit-license.php. #include <core_io.h> +#include <hash.h> #include <key_io.h> #include <rpc/util.h> #include <util/moneystr.h> @@ -679,8 +680,7 @@ RPCHelpMan listunspent() CHECK_NONFATAL(extracted); // Also return the witness script const WitnessV0ScriptHash& whash = std::get<WitnessV0ScriptHash>(witness_destination); - CScriptID id; - CRIPEMD160().Write(whash.begin(), whash.size()).Finalize(id.begin()); + CScriptID id{RIPEMD160(whash)}; CScript witnessScript; if (provider->GetCScript(id, witnessScript)) { entry.pushKV("witnessScript", HexStr(witnessScript)); @@ -689,8 +689,7 @@ RPCHelpMan listunspent() } } else if (scriptPubKey.IsPayToWitnessScriptHash()) { const WitnessV0ScriptHash& whash = std::get<WitnessV0ScriptHash>(address); - CScriptID id; - CRIPEMD160().Write(whash.begin(), whash.size()).Finalize(id.begin()); + CScriptID id{RIPEMD160(whash)}; CScript witnessScript; if (provider->GetCScript(id, witnessScript)) { entry.pushKV("witnessScript", HexStr(witnessScript)); |