| 1515 | } |
| 1516 | |
| 1517 | void 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 | |
| 1535 | bool LegacyScriptPubKeyMan::AddCScript(const CScript& redeemScript) |
| 1536 | { |