mirror of
https://github.com/bitcoin/bitcoin.git
synced 2025-11-13 07:28:59 +01:00
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:
committed by
Pieter Wuille
parent
2aa462ec30
commit
1657c4bc49
@@ -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)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user