Add support for out of order blocks and tolerance for future stamped blocks
In order to speed up block propagation, it is possible for some blocks to arrive out of order due to propagation delays combined with 2 or more blocks mined very quickly. Additionally futurestamping blocks allows a high hash rate miner to produce blocks that would be valid after a passage of time. Previously such blocks triggered an extreme response that banned the peer that broadcast it. Since these are temporary issues, if the block is still valid when it is within the allowed timestamp window, this update will process it normally.
This commit is contained in:
@@ -261,7 +261,7 @@ BOOST_AUTO_TEST_CASE(CreateNewBlock_validity)
|
||||
*/
|
||||
|
||||
CValidationState state;
|
||||
BOOST_CHECK(ProcessNewBlock(state, NULL, pblock, true, NULL));
|
||||
BOOST_CHECK(ProcessNewBlock(1,chainActive.Height()+1,state, NULL, pblock, true, NULL));
|
||||
BOOST_CHECK_MESSAGE(state.IsValid(), state.GetRejectReason());
|
||||
pblock->hashPrevBlock = pblock->GetHash();
|
||||
|
||||
|
||||
Reference in New Issue
Block a user