From 70946e7fee54323ce6a5ea8aeb377e2c7c790bc6 Mon Sep 17 00:00:00 2001 From: Gregory Sanders Date: Tue, 19 Feb 2019 17:00:45 -0500 Subject: Replace CScriptID and CKeyID in CTxDestination with dedicated types --- src/keystore.cpp | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) (limited to 'src/keystore.cpp') diff --git a/src/keystore.cpp b/src/keystore.cpp index 148979cf3..f6d19416c 100644 --- a/src/keystore.cpp +++ b/src/keystore.cpp @@ -178,16 +178,17 @@ CKeyID GetKeyForDestination(const CKeyStore& store, const CTxDestination& dest) { // Only supports destinations which map to single public keys, i.e. P2PKH, // P2WPKH, and P2SH-P2WPKH. - if (auto id = boost::get(&dest)) { - return *id; + if (auto id = boost::get(&dest)) { + return CKeyID(*id); } if (auto witness_id = boost::get(&dest)) { return CKeyID(*witness_id); } - if (auto script_id = boost::get(&dest)) { + if (auto script_hash = boost::get(&dest)) { CScript script; + CScriptID script_id(*script_hash); CTxDestination inner_dest; - if (store.GetCScript(*script_id, script) && ExtractDestination(script, inner_dest)) { + if (store.GetCScript(script_id, script) && ExtractDestination(script, inner_dest)) { if (auto inner_witness_id = boost::get(&inner_dest)) { return CKeyID(*inner_witness_id); } -- cgit v1.2.3