|
@ -599,9 +599,13 @@ ImportRoute BlockChain::import(VerifiedBlockRef const& _block, OverlayDB const& |
|
|
if (common != last) |
|
|
if (common != last) |
|
|
{ |
|
|
{ |
|
|
// Erase the number-lookup cache for the segment of the chain that we're reverting (if any).
|
|
|
// Erase the number-lookup cache for the segment of the chain that we're reverting (if any).
|
|
|
|
|
|
unsigned n = number(route.front()); |
|
|
DEV_WRITE_GUARDED(x_blockHashes) |
|
|
DEV_WRITE_GUARDED(x_blockHashes) |
|
|
for (auto i = route.begin(); i != route.end() && *i != common; ++i) |
|
|
for (auto i = route.begin(); i != route.end() && *i != common; ++i, --n) |
|
|
m_blockHashes.erase(h256(u256(number(*i)))); |
|
|
m_blockHashes.erase(h256(u256(n))); |
|
|
|
|
|
DEV_WRITE_GUARDED(x_transactionAddresses) |
|
|
|
|
|
m_transactionAddresses.clear(); // TODO: could perhaps delete them individually?
|
|
|
|
|
|
|
|
|
// If we are reverting previous blocks, we need to clear their blooms (in particular, to
|
|
|
// If we are reverting previous blocks, we need to clear their blooms (in particular, to
|
|
|
// rebuild any higher level blooms that they contributed to).
|
|
|
// rebuild any higher level blooms that they contributed to).
|
|
|
clearBlockBlooms(number(common) + 1, number(last) + 1); |
|
|
clearBlockBlooms(number(common) + 1, number(last) + 1); |
|
@ -636,7 +640,7 @@ ImportRoute BlockChain::import(VerifiedBlockRef const& _block, OverlayDB const& |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
// Collate transaction hashes and remember who they were.
|
|
|
// Collate transaction hashes and remember who they were.
|
|
|
h256s newTransactionAddresses; |
|
|
//h256s newTransactionAddresses;
|
|
|
{ |
|
|
{ |
|
|
bytes blockBytes; |
|
|
bytes blockBytes; |
|
|
RLP blockRLP(*i == _block.info.hash() ? _block.block : &(blockBytes = block(*i))); |
|
|
RLP blockRLP(*i == _block.info.hash() ? _block.block : &(blockBytes = block(*i))); |
|
|