diff --git a/libethereum/BlockQueue.cpp b/libethereum/BlockQueue.cpp index b76e4bed6..d98dac3ba 100644 --- a/libethereum/BlockQueue.cpp +++ b/libethereum/BlockQueue.cpp @@ -29,7 +29,7 @@ using namespace std; using namespace dev; using namespace dev::eth; -ImportResult BlockQueue::import(bytesConstRef _block, BlockChain const& _bc) +ImportResult BlockQueue::import(bytesConstRef _block, BlockChain const& _bc, bool _isOurs) { // Check if we already know this block. h256 h = BlockInfo::headerHash(_block); @@ -70,7 +70,7 @@ ImportResult BlockQueue::import(bytesConstRef _block, BlockChain const& _bc) UpgradeGuard ul(l); // Check it's not in the future - if (bi.timestamp > (u256)time(0)) + if (bi.timestamp > (u256)time(0) && !_isOurs) { m_future.insert(make_pair((unsigned)bi.timestamp, _block.toBytes())); cblockq << "OK - queued for future."; diff --git a/libethereum/BlockQueue.h b/libethereum/BlockQueue.h index 4a503d114..631877292 100644 --- a/libethereum/BlockQueue.h +++ b/libethereum/BlockQueue.h @@ -55,7 +55,7 @@ class BlockQueue { public: /// Import a block into the queue. - ImportResult import(bytesConstRef _tx, BlockChain const& _bc); + ImportResult import(bytesConstRef _tx, BlockChain const& _bc, bool _isOurs = false); /// Notes that time has moved on and some blocks that used to be "in the future" may no be valid. void tick(BlockChain const& _bc); diff --git a/libethereum/Client.cpp b/libethereum/Client.cpp index 4f9af91a9..9e69c8128 100644 --- a/libethereum/Client.cpp +++ b/libethereum/Client.cpp @@ -425,7 +425,7 @@ bool Client::submitWork(ProofOfWork::Solution const& _solution) return false; newBlock = m_postMine.blockData(); } - m_bq.import(&newBlock, m_bc); + m_bq.import(&newBlock, m_bc, true); /* ImportRoute ir = m_bc.attemptImport(newBlock, m_stateDB); if (!ir.first.empty())