diff options
author | Pieter Wuille <pieter.wuille@gmail.com> | 2013-11-16 19:28:24 +0100 |
---|---|---|
committer | Pieter Wuille <pieter.wuille@gmail.com> | 2014-01-27 21:20:41 +0100 |
commit | 75f51f2a63e0ebe34ab290c2b7141dd240b98c3b (patch) | |
tree | ed9be9e3acbcd9d9df9f67264042109b8cd7db98 /src/init.cpp | |
parent | 0ec16f35d6b8d9f1fe876f1405f105f6e5aa0933 (diff) |
Prepare block connection logic for headers-first.
This changes the block processing logic from "try to atomically switch
to a new block" to a continuous "(dis)connect a block, aiming for the
assumed best chain".
This means the smallest atomic operations on the chainstate become
individual block connections or disconnections, instead of entire
reorganizations. It may mean that we try to reorganize to one block,
fail, and rereorganize again to the old block. This is slower, but
doesn't require unbounded RAM.
It also means that a ConnectBlock which fails may be no longer called
from the ProcessBlock which knows which node sent it. To deal with that,
a mapBlockSource is kept, and invalid blocks cause asynchronous "reject"
messages and banning (if necessary).
Diffstat (limited to 'src/init.cpp')
-rw-r--r-- | src/init.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/init.cpp b/src/init.cpp index 7213477b22..8520d63c89 100644 --- a/src/init.cpp +++ b/src/init.cpp @@ -983,7 +983,7 @@ bool AppInit2(boost::thread_group& threadGroup) // scan for better chains in the block chain database, that are not yet connected in the active best chain CValidationState state; - if (!ConnectBestBlock(state)) + if (!ActivateBestChain(state)) strErrors << "Failed to connect best block"; std::vector<boost::filesystem::path> vImportFiles; |