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.
This commit is contained in:
Pieter Wuille
2013-03-28 23:51:50 +01:00
committed by Pieter Wuille
parent 2aa462ec30
commit 1657c4bc49
5 changed files with 48 additions and 36 deletions

View File

@@ -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)
{