bitcoinj icon indicating copy to clipboard operation
bitcoinj copied to clipboard

NetworkParameters: convert spacing and timespans to `java.time.Duration`

Open schildbach opened this issue 11 months ago • 2 comments

This is two commits:

  • BitcoinNetworkParams: move spacing, timespan, interval constants from NetworkParameters Also rename INTERVAL to INTERVAL_BLOCKS.

  • NetworkParameters: convert spacing and timespans to java.time.Duration

schildbach avatar Mar 16 '25 11:03 schildbach

Damn, the referencing of superclass to subclass at init time is clearly not liked by the VM at runtime.

Thinking about the moving of the constants again, maybe we want to move them (and their variable friends and accessors) to BitcoinNetwork? Or, if we don't want to grow that class too much, create a new hierarchy just for "blockchain parameters"?

schildbach avatar Mar 16 '25 11:03 schildbach

I converted this to draft because currently it doesn't work as planned. Maybe it's better to merge the Difficulty refactor first, then decide on where the constants should really go.

But I certainly want to revisit especially the "move to java.time.Duration" commit again.

schildbach avatar Mar 16 '25 11:03 schildbach