diff options
author | Andrew Chow <github@achow101.com> | 2023-08-08 10:35:08 -0400 |
---|---|---|
committer | Andrew Chow <github@achow101.com> | 2023-08-14 17:38:27 -0400 |
commit | b81ebff0d99c45c071b999796b8ae3f0f2517b22 (patch) | |
tree | 0c216069b0470df9c291f61c67a4d6cc367fa919 /src/wallet | |
parent | cba69dda3da0e4fa39cff5ce4dc81d1242fe651b (diff) |
Remove ScriptHash from CScriptID constructor
Replaces the constructor in CScriptID that converts a ScriptHash with a
function ToScriptID that does the same. This prepares for a move of
CScriptID to avoid a circular dependency.
Diffstat (limited to 'src/wallet')
-rw-r--r-- | src/wallet/rpc/addresses.cpp | 3 | ||||
-rw-r--r-- | src/wallet/rpc/coins.cpp | 2 |
2 files changed, 2 insertions, 3 deletions
diff --git a/src/wallet/rpc/addresses.cpp b/src/wallet/rpc/addresses.cpp index a8ef0a5731..06f396a6d7 100644 --- a/src/wallet/rpc/addresses.cpp +++ b/src/wallet/rpc/addresses.cpp @@ -440,10 +440,9 @@ public: UniValue operator()(const ScriptHash& scripthash) const { - CScriptID scriptID(scripthash); UniValue obj(UniValue::VOBJ); CScript subscript; - if (provider && provider->GetCScript(scriptID, subscript)) { + if (provider && provider->GetCScript(ToScriptID(scripthash), subscript)) { ProcessSubScript(subscript, obj); } return obj; diff --git a/src/wallet/rpc/coins.cpp b/src/wallet/rpc/coins.cpp index 22f0f0b83c..521378e188 100644 --- a/src/wallet/rpc/coins.cpp +++ b/src/wallet/rpc/coins.cpp @@ -672,7 +672,7 @@ RPCHelpMan listunspent() std::unique_ptr<SigningProvider> provider = pwallet->GetSolvingProvider(scriptPubKey); if (provider) { if (scriptPubKey.IsPayToScriptHash()) { - const CScriptID& hash = CScriptID(std::get<ScriptHash>(address)); + const CScriptID hash = ToScriptID(std::get<ScriptHash>(address)); CScript redeemScript; if (provider->GetCScript(hash, redeemScript)) { entry.pushKV("redeemScript", HexStr(redeemScript)); |