This implements code for calculating a uint256 work value from difficulty bits along with associated tests. The function is the semantic equivalent of CalcWork from blockchain/standalone updated to use and return the new uint256 type instead of stdlib big integers. Note that the original calculation involves a dividend of 2^256 which is not directly representable by a uint256, so this implementation retains the same semantics by transforming the calculation as described in detail by the comments. |
||
|---|---|---|
| .. | ||
| fees | ||
| limits | ||
| mempool | ||
| mining | ||
| netsync | ||
| progresslog | ||
| rpcserver | ||
| staging/primitives | ||
| version | ||