From 2c54217f913967703b404747133be67cf2f4feac Mon Sep 17 00:00:00 2001 From: Ben Woosley Date: Wed, 15 Jan 2020 13:40:14 -0800 Subject: Use explicit conversion from PKHash -> CKeyID These types are equivalent, in data etc, so they need only their data cast across. Note a function is used rather than a casting operator as CKeyID is defined at a lower level than script/standard --- src/script/signingprovider.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/script/signingprovider.cpp') diff --git a/src/script/signingprovider.cpp b/src/script/signingprovider.cpp index 01757e2f6..a4eb0a839 100644 --- a/src/script/signingprovider.cpp +++ b/src/script/signingprovider.cpp @@ -180,7 +180,7 @@ CKeyID GetKeyForDestination(const SigningProvider& store, const CTxDestination& // Only supports destinations which map to single public keys, i.e. P2PKH, // P2WPKH, and P2SH-P2WPKH. if (auto id = boost::get(&dest)) { - return CKeyID(*id); + return ToKeyID(*id); } if (auto witness_id = boost::get(&dest)) { return CKeyID(*witness_id); -- cgit v1.2.3 From f32c1e07fd6c174ff3f6406a619550d2f6c19360 Mon Sep 17 00:00:00 2001 From: Ben Woosley Date: Wed, 15 Jan 2020 13:41:25 -0800 Subject: Use explicit conversion from WitnessV0KeyHash -> CKeyID These types are equivalent, in data etc, so they need only their data cast across. --- src/script/signingprovider.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/script/signingprovider.cpp') diff --git a/src/script/signingprovider.cpp b/src/script/signingprovider.cpp index a4eb0a839..2d8dc7d47 100644 --- a/src/script/signingprovider.cpp +++ b/src/script/signingprovider.cpp @@ -183,7 +183,7 @@ CKeyID GetKeyForDestination(const SigningProvider& store, const CTxDestination& return ToKeyID(*id); } if (auto witness_id = boost::get(&dest)) { - return CKeyID(*witness_id); + return ToKeyID(*witness_id); } if (auto script_hash = boost::get(&dest)) { CScript script; @@ -191,7 +191,7 @@ CKeyID GetKeyForDestination(const SigningProvider& store, const CTxDestination& CTxDestination 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); + return ToKeyID(*inner_witness_id); } } } -- cgit v1.2.3