removes the key, its lablel and its private key */
| 413 | |
| 414 | /** removes the key, its lablel and its private key */ |
| 415 | bool Wallet::removePublicKey(QString pubkey) |
| 416 | { |
| 417 | if( !isOpen() ) return false; |
| 418 | auto pub = fc::variant( pubkey.toStdString() ).as<public_key_type>(); |
| 419 | _available_private_keys.erase(pub); |
| 420 | |
| 421 | auto itr = _data.encrypted_private_keys.find(pub); |
| 422 | if( itr != _data.encrypted_private_keys.end() ) |
| 423 | { |
| 424 | _label_to_key.erase(QString::fromStdString(itr->second.label)); |
| 425 | _data.encrypted_private_keys.erase(itr); |
| 426 | return true; |
| 427 | } |
| 428 | return false; |
| 429 | } |
| 430 | |
| 431 | /** removes only the private key, keeping the public key and label |
| 432 | * |