diff options
| author | Gregory Sanders <[email protected]> | 2019-02-19 17:00:45 -0500 |
|---|---|---|
| committer | Gregory Sanders <[email protected]> | 2019-04-29 10:15:23 -0400 |
| commit | 70946e7fee54323ce6a5ea8aeb377e2c7c790bc6 (patch) | |
| tree | 8214716fc7275e3b32bc0c28bdfab5df44ad6a4f /src/keystore.cpp | |
| parent | Merge #15866: test: Add missing syncwithvalidationinterfacequeue to wallet_im... (diff) | |
| download | discoin-70946e7fee54323ce6a5ea8aeb377e2c7c790bc6.tar.xz discoin-70946e7fee54323ce6a5ea8aeb377e2c7c790bc6.zip | |
Replace CScriptID and CKeyID in CTxDestination with dedicated types
Diffstat (limited to 'src/keystore.cpp')
| -rw-r--r-- | src/keystore.cpp | 9 |
1 files changed, 5 insertions, 4 deletions
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<CKeyID>(&dest)) { - return *id; + if (auto id = boost::get<PKHash>(&dest)) { + return CKeyID(*id); } if (auto witness_id = boost::get<WitnessV0KeyHash>(&dest)) { return CKeyID(*witness_id); } - if (auto script_id = boost::get<CScriptID>(&dest)) { + if (auto script_hash = boost::get<ScriptHash>(&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<WitnessV0KeyHash>(&inner_dest)) { return CKeyID(*inner_witness_id); } |