diff options
author | Pieter Wuille <pieter.wuille@gmail.com> | 2012-03-10 23:04:06 +0100 |
---|---|---|
committer | Pieter Wuille <pieter.wuille@gmail.com> | 2012-03-12 20:31:56 +0100 |
commit | d68dcf741e088d8d7033521aa1a1e5e87d9dd283 (patch) | |
tree | 5b98bddc5cb9258e5afab24505ad3dba7238b31a /src/main.h | |
parent | 336ba312a6ddc08f40ce456bfd09f0711bdc78dc (diff) |
Limit the impact of reorganisations on the database
Sometimes a new block arrives in a new chain that was already the
best valid one, but wasn't marked that way. This happens for example
when network rules change to recover after a fork.
In this case, it is not necessary to do the entire reorganisation
inside a single db commit. These can become huge, and exceed the
objects/lockers limits in bdb. This patch limits the blocks the
actual reorganisation is applied to, and adds the next blocks
afterwards in separate db transactions.
Diffstat (limited to 'src/main.h')
-rw-r--r-- | src/main.h | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/src/main.h b/src/main.h index 25750dae46..b731d896e8 100644 --- a/src/main.h +++ b/src/main.h @@ -1030,6 +1030,9 @@ public: bool AddToBlockIndex(unsigned int nFile, unsigned int nBlockPos); bool CheckBlock() const; bool AcceptBlock(); + +private: + bool SetBestChainInner(CTxDB& txdb, CBlockIndex *pindexNew); }; |