mirror of
https://github.com/btcsuite/btcd.git
synced 2026-08-14 12:42:51 +02:00
Some of the functions in difficulty.go are not dependent on any external functions and they are needed to introduce testing code for the invalidateblock and reconsiderblock methods that are to be added on in later commits. Having the workmath package let's us reuse the code and avoid dependency cycles. The existing functions that were exported already (HashToBig, CompactToBig, BigToCompact, CalcWork) are still kept in difficulty.go to avoid breaking external code that depends on those exported functions.
630 B
630 B
workmath
Package workmath provides utility functions that are related with calculating the work from difficulty bits. This package was introduced to avoid import cycles in btcd.
License
Package workmath is licensed under the copyfree ISC License.