| 484 | } |
| 485 | |
| 486 | bool CWallet::CleanAll() { |
| 487 | for_each(unconfirmedTx.begin(), unconfirmedTx.end(), |
| 488 | [&](std::map<uint256, std::shared_ptr<CBaseTx> >::reference a) { |
| 489 | CWalletDB(strWalletFile).EraseUnconfirmedTx(a.first); |
| 490 | }); |
| 491 | unconfirmedTx.clear(); |
| 492 | |
| 493 | for_each(mapInBlockTx.begin(), mapInBlockTx.end(), [&](std::map<uint256, CWalletAccountTxDb>::reference a) { |
| 494 | CWalletDB(strWalletFile).EraseUnconfirmedTx(a.first); } ); |
| 495 | |
| 496 | mapInBlockTx.clear(); |
| 497 | |
| 498 | bestBlock.SetNull(); |
| 499 | |
| 500 | if (!IsEncrypted()) { |
| 501 | for_each(mapKeys.begin(), mapKeys.end(), [&](std::map<CKeyID, CKeyCombi>::reference item) { |
| 502 | CWalletDB(strWalletFile).EraseKeyStoreValue(item.first); |
| 503 | }); |
| 504 | mapKeys.clear(); |
| 505 | } else { |
| 506 | return ERRORMSG("wallet is encrypted hence clear data forbidden!"); |
| 507 | } |
| 508 | return true; |
| 509 | } |
| 510 | |
| 511 | bool CWallet::Sign(const CKeyID &keyId, const uint256 &hash, vector<uint8_t> &signature, bool isMiner) const { |
| 512 | CKey key; |
nothing calls this directly
no test coverage detected