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. --- src/uint256.h | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'src/uint256.h') diff --git a/src/uint256.h b/src/uint256.h index eb0066fa27..8a9af8ba04 100644 --- a/src/uint256.h +++ b/src/uint256.h @@ -55,6 +55,16 @@ public: return ret; } + double getdouble() const + { + double ret = 0.0; + double fact = 1.0; + for (int i = 0; i < WIDTH; i++) { + ret += fact * pn[i]; + fact *= 4294967296.0; + } + return ret; + } base_uint& operator=(uint64 b) { -- cgit v1.2.3