Create checkpoints with 12 (or less) bytes of work in the old V1 format,
otherwise V2. This will make checkpoint files easier to review.
This un-deprecates the V1 format in StoredBlock, since it's no longer
planned to remove that in the forseeable future.
This also reverts recent changes to the bundled checkpoints
(commit de8afc67ca).
* `BuildCheckpoints` now always creates checkpoints with 32 byte chain work
* `CheckpointManager` knows how to read both 12 and 32 byte chain work
Also updates the bundled checkpoints to the new format and a test.
This is a fix for Issue #3410 that will allow main net blocks above
849,137 to be processed. As of block 849,138 we can no longer fit
total chainwork in a 12-byte *signed* field. This fix "kicks the can
down the road" by making the field 12-bytes *unsigned*.
We should open a new issue to address the long term need for bigger
values. Note that converting the field to 12-byte unsigned precludes
us from using the most-significant bit as a flag for a new format, but
we should be able to pick some arbitrary value, say 0xA0 as a version
flag and declare that values less than 0xA0 are "unversioned".
There are use cases where an already parsed address needs to be validated
for a specific network. In one use case the address came from an external
source and needs validation with an error message displayed: that's what
`isValidAddress(Address)` is for. In the other case we can treat the invalid
address as a fatal error. That's `checkAddress(Address)`.
* Make the static field ECKey.CURVE (which is a Bouncy Castle
type) package private and provide the ecDomainParameters() accessor
for those who really need it.
* Use the accessor in DefaultRiskAnalysisTest
* We will not update code within the `o.b.crytpo` package
to use the accessor, since we intend to migrate all/most
of those usages to the `java.security` types.
We do not need to specify the curve for each instance as
bitcoinj uses SECP256K1 curve exclusively.
This change reduces per instance memory usage, simplifies the API,
and reduces public API dependence on Bouncy Castle.
One two-arg constructor is deprecated and replaced with a single-arg
constructor that no longer requires the curve parameter.
Just to be extra safe, in the deprecated method we validate the curve
argument and make sure it is the P256K1 curve.
Also correctly mark private `bits` field as @Nullable, and improve
JavaDoc and other comments.