MCPcopy Create free account
hub / github.com/cryptonomex/graphene / hasPrivateKey

Method hasPrivateKey

programs/light_client/Wallet.cpp:221–236  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

219 return true;
220}
221bool Wallet::hasPrivateKey(QString pubkey, bool include_with_brain_key)
222{
223 auto pub = fc::variant(pubkey.toStdString()).as<public_key_type>();
224 auto itr = _data.encrypted_private_keys.find(pub);
225 if( itr == _data.encrypted_private_keys.end() )
226 return false;
227 if( itr->second.encrypted_private_key.size() )
228 return true;
229 if( include_with_brain_key && itr->second.brain_sequence >= 0 )
230 {
231 if( !itr->second.owner )
232 return true;
233 return hasPrivateKey(toQString(*itr->second.owner), include_with_brain_key);
234 }
235 return false;
236}
237
238QString Wallet::getPrivateKey(QString pubkey)
239{

Callers 4

getActiveControlMethod · 0.80
getOwnerControlMethod · 0.80
canEncryptMemoMethod · 0.80
canDecryptMemoMethod · 0.80

Calls 5

variantClass · 0.85
toQStringFunction · 0.85
findMethod · 0.45
endMethod · 0.45
sizeMethod · 0.45

Tested by

no test coverage detected