From 0fe8010a10bafd67f9131b2da034fb9cd7fc5024 Mon Sep 17 00:00:00 2001 From: Pieter Wuille Date: Sun, 12 May 2013 15:50:22 +0200 Subject: Make FindBlockByHeight constant-time. Remove the pnext pointer in CBlockIndex, and replace it with a vBlockIndexByHeight vector (no effect on memory usage). pnext can now be replaced by vBlockIndexByHeight[nHeight+1], but FindBlockByHeight becomes constant-time. This also means the entire mapBlockIndex structure and the block index entries in it become purely blocktree-related data, and independent from the currently active chain, potentially allowing them to be protected by separate mutexes in the future. --- contrib/test-patches/bitcoind-comparison.patch | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'contrib/test-patches') diff --git a/contrib/test-patches/bitcoind-comparison.patch b/contrib/test-patches/bitcoind-comparison.patch index 7464349b3c..f82b102e2a 100644 --- a/contrib/test-patches/bitcoind-comparison.patch +++ b/contrib/test-patches/bitcoind-comparison.patch @@ -3,9 +3,9 @@ index 04a8618..519429a 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -31,8 +31,8 @@ CTxMemPool mempool; - unsigned int nTransactionsUpdated = 0; map mapBlockIndex; + std::vector vBlockIndexByHeight; -uint256 hashGenesisBlock("0x000000000019d6689c085ae165831e934ff763ae46a2a6c172b3f1b60a8ce26f"); -static CBigNum bnProofOfWorkLimit(~uint256(0) >> 32); +uint256 hashGenesisBlock("0x0f9188f13cb7b2c71f2a335e3a4fc328bf5beb436012afca590b1a11466e2206"); -- cgit v1.2.3