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

Method MarkPreSplitKeys

src/wallet/scriptpubkeyman.cpp:1517–1533  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1515}
1516
1517void LegacyScriptPubKeyMan::MarkPreSplitKeys()
1518{
1519 WalletBatch batch(m_storage.GetDatabase());
1520 for (auto it = setExternalKeyPool.begin(); it != setExternalKeyPool.end();) {
1521 int64_t index = *it;
1522 CKeyPool keypool;
1523 if (!batch.ReadPool(index, keypool)) {
1524 throw std::runtime_error(std::string(__func__) + ": read keypool entry failed");
1525 }
1526 keypool.m_pre_split = true;
1527 if (!batch.WritePool(index, keypool)) {
1528 throw std::runtime_error(std::string(__func__) + ": writing modified keypool entry failed");
1529 }
1530 set_pre_split_keypool.insert(index);
1531 it = setExternalKeyPool.erase(it);
1532 }
1533}
1534
1535bool LegacyScriptPubKeyMan::AddCScript(const CScript& redeemScript)
1536{

Callers

nothing calls this directly

Calls 6

ReadPoolMethod · 0.80
WritePoolMethod · 0.80
beginMethod · 0.45
endMethod · 0.45
insertMethod · 0.45
eraseMethod · 0.45

Tested by

no test coverage detected