Changeset View
Changeset View
Standalone View
Standalone View
src/keystore.cpp
Show First 20 Lines • Show All 163 Lines • ▼ Show 20 Lines | |||||
CKeyID GetKeyForDestination(const CKeyStore &store, | CKeyID GetKeyForDestination(const CKeyStore &store, | ||||
const CTxDestination &dest) { | const CTxDestination &dest) { | ||||
// Only supports destinations which map to single public keys, i.e. P2PKH. | // Only supports destinations which map to single public keys, i.e. P2PKH. | ||||
if (auto id = boost::get<CKeyID>(&dest)) { | if (auto id = boost::get<CKeyID>(&dest)) { | ||||
return *id; | return *id; | ||||
} | } | ||||
return CKeyID(); | return CKeyID(); | ||||
} | } | ||||
bool HaveKey(const CKeyStore &store, const CKey &key) { | |||||
CKey key2; | |||||
key2.Set(key.begin(), key.end(), !key.IsCompressed()); | |||||
return store.HaveKey(key.GetPubKey().GetID()) || | |||||
store.HaveKey(key2.GetPubKey().GetID()); | |||||
} |