mirror of https://github.com/oxen-io/oxen-core.git
ed161e2ec4
This adds a new table to the batching schema to copy the accrued balances every so often. This means that we can jump back to a previous point without popping blocks. The archiving is triggered in sql every 100 blocks and added to the archive table, then pruned from the archive table at a later time to ensure the size is kept small. Rebuilding 100 blocks is pretty reasonable and should be less than 10s. For longer distance pop_blocks and blockchain detached every 10k blocks is kept in the archiving table. This takes longer to rebuild but is better than rebuilding from scratch. The blockchain detached function is also added to our regular blockchain detached hooks so that it gets called every time the blockchain detaches. Which appears to have caused some issues previously when some of the modules would detach but batching would be stuck in an advanced state. |
||
---|---|---|
.. | ||
lmdb | ||
sqlite | ||
CMakeLists.txt | ||
blockchain_db.cpp | ||
blockchain_db.h | ||
locked_txn.h | ||
testdb.h |