From 1657c4bc495815febc2137972c3c63b99d2b0189 Mon Sep 17 00:00:00 2001 From: Pieter Wuille Date: Thu, 28 Mar 2013 23:51:50 +0100 Subject: Use a uint256 for bnChainWork Every block index entry currently requires a separately-allocated CBigNum. By replacing them with uint256, it's just 32 bytes extra in CBlockIndex itself. This should save us a few megabytes in RAM, and less allocation overhead. --- contrib/test-patches/bitcoind-comparison.patch | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'contrib') diff --git a/contrib/test-patches/bitcoind-comparison.patch b/contrib/test-patches/bitcoind-comparison.patch index 04a8618286..7464349b3c 100644 --- a/contrib/test-patches/bitcoind-comparison.patch +++ b/contrib/test-patches/bitcoind-comparison.patch @@ -1,5 +1,5 @@ -diff --git a/src/main.cpp b/src/main.cpp -index 8c115c2..1e70ff2 100644 +diff --git a/contrib/test-patches/bitcoind-comparison.patch b/contrib/test-patches/bitcoind-comparison.patch +index 04a8618..519429a 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -31,8 +31,8 @@ CTxMemPool mempool; @@ -12,7 +12,7 @@ index 8c115c2..1e70ff2 100644 +static CBigNum bnProofOfWorkLimit(~uint256(0) >> 1); CBlockIndex* pindexGenesisBlock = NULL; int nBestHeight = -1; - CBigNum bnBestChainWork = 0; + uint256 nBestChainWork = 0; @@ -1055,7 +1055,7 @@ int64 static GetBlockValue(int nHeight, int64 nFees) int64 nSubsidy = 50 * COIN; @@ -22,7 +22,7 @@ index 8c115c2..1e70ff2 100644 return nSubsidy + nFees; } -@@ -2706,9 +2706,9 @@ bool InitBlockIndex() { +@@ -2736,9 +2736,9 @@ bool InitBlockIndex() { block.hashPrevBlock = 0; block.hashMerkleRoot = block.BuildMerkleTree(); block.nVersion = 1; @@ -35,7 +35,7 @@ index 8c115c2..1e70ff2 100644 if (fTestNet) { -@@ -3007,7 +3007,7 @@ bool static AlreadyHave(const CInv& inv) +@@ -3024,7 +3024,7 @@ bool static AlreadyHave(const CInv& inv) // The message start string is designed to be unlikely to occur in normal data. // The characters are rarely used upper ASCII, not valid as UTF-8, and produce // a large 4-byte int at any alignment. -- cgit v1.2.3