| 1354 | } |
| 1355 | |
| 1356 | void LegacyScriptPubKeyMan::KeepDestination(int64_t nIndex, const OutputType& type) |
| 1357 | { |
| 1358 | assert(type != OutputType::BECH32M); |
| 1359 | // Remove from key pool |
| 1360 | WalletBatch batch(m_storage.GetDatabase()); |
| 1361 | batch.ErasePool(nIndex); |
| 1362 | CPubKey pubkey; |
| 1363 | bool have_pk = GetPubKey(m_index_to_reserved_key.at(nIndex), pubkey); |
| 1364 | assert(have_pk); |
| 1365 | LearnRelatedScripts(pubkey, type); |
| 1366 | m_index_to_reserved_key.erase(nIndex); |
| 1367 | WalletLogPrintf("keypool keep %d\n", nIndex); |
| 1368 | } |
| 1369 | |
| 1370 | void LegacyScriptPubKeyMan::ReturnDestination(int64_t nIndex, bool fInternal, const CTxDestination&) |
| 1371 | { |