MCPcopy Create free account
hub / github.com/ElementsProject/elements / ReturnDestination

Method ReturnDestination

src/wallet/scriptpubkeyman.cpp:1370–1388  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1368}
1369
1370void LegacyScriptPubKeyMan::ReturnDestination(int64_t nIndex, bool fInternal, const CTxDestination&)
1371{
1372 // Return to key pool
1373 {
1374 LOCK(cs_KeyStore);
1375 if (fInternal) {
1376 setInternalKeyPool.insert(nIndex);
1377 } else if (!set_pre_split_keypool.empty()) {
1378 set_pre_split_keypool.insert(nIndex);
1379 } else {
1380 setExternalKeyPool.insert(nIndex);
1381 }
1382 CKeyID& pubkey_id = m_index_to_reserved_key.at(nIndex);
1383 m_pool_key_to_index[pubkey_id] = nIndex;
1384 m_index_to_reserved_key.erase(nIndex);
1385 NotifyCanGetAddressesChanged();
1386 }
1387 WalletLogPrintf("keypool return %d\n", nIndex);
1388}
1389
1390bool LegacyScriptPubKeyMan::GetKeyFromPool(CPubKey& result, const OutputType type, bool internal)
1391{

Callers

nothing calls this directly

Calls 6

WalletBatchClass · 0.85
insertMethod · 0.45
emptyMethod · 0.45
eraseMethod · 0.45
WriteDescriptorMethod · 0.45

Tested by

no test coverage detected