aboutsummaryrefslogtreecommitdiff
path: root/src/wallet/wallet.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/wallet/wallet.cpp')
-rw-r--r--src/wallet/wallet.cpp4
1 files changed, 1 insertions, 3 deletions
diff --git a/src/wallet/wallet.cpp b/src/wallet/wallet.cpp
index c93bef1fc7..78a6c2bd67 100644
--- a/src/wallet/wallet.cpp
+++ b/src/wallet/wallet.cpp
@@ -4538,9 +4538,7 @@ CTxDestination CWallet::AddAndGetDestinationForScript(const CScript& script, Out
return CScriptID(script);
case OutputType::P2SH_SEGWIT:
case OutputType::BECH32: {
- WitnessV0ScriptHash hash;
- CSHA256().Write(script.data(), script.size()).Finalize(hash.begin());
- CTxDestination witdest = hash;
+ CTxDestination witdest = WitnessV0ScriptHash(script);
CScript witprog = GetScriptForDestination(witdest);
// Check if the resulting program is solvable (i.e. doesn't use an uncompressed key)
if (!IsSolvable(*this, witprog)) return CScriptID(script);