Files
purple-electrumwallet/electrum
davide d1088c036e blockchain: generalize difficulty adjustment for per-chain PoW constants
get_target(): replace hardcoded Bitcoin constants (CHUNK_SIZE, 14-day
timespan, module-level MAX_TARGET) with per-chain values from constants.net.
Handle POW_GENESIS_BITS so that chains whose genesis nBits differs from
target_to_bits(MAX_TARGET) return the correct initial difficulty for period 0.
Map checkpoint indices correctly when adj_interval != CHUNK_SIZE.

verify_chunk(): add a separate code path for chains where the retarget
interval is shorter than CHUNK_SIZE (e.g. BTCP: 120 vs 2016).  In this
case multiple retargets can occur within a single chunk; because the headers
are not yet on disk during verification, reading via read_header() would
raise MissingHeader and reject the entire chunk.  Fix by reading from the
in-memory data buffer via a local helper _read_hdr(), and tracking
current_target across period boundaries inline.

can_connect(), chainwork_of_header_at_height(): use adj_interval instead of
CHUNK_SIZE when computing the difficulty-period index so that BTCP's 120-block
retarget windows are respected
2026-04-29 10:08:14 +02:00
..
2026-02-21 03:51:52 +00:00
2026-04-27 16:28:24 +02:00
2026-04-27 16:28:19 +02:00
2026-04-27 15:28:39 +00:00
2026-04-08 10:45:59 +02:00
2026-03-20 17:43:12 +00:00
2026-04-27 16:28:19 +02:00
2026-01-28 17:49:36 +01:00
2026-04-27 16:28:19 +02:00
2026-04-28 10:22:10 +02:00
2026-03-20 18:14:38 +00:00
2026-03-27 13:15:07 +00:00
2026-04-28 10:22:10 +02:00
2026-04-27 16:28:19 +02:00
2026-03-20 18:14:38 +00:00