]> Untitled Git - bdk/commit
feat(core): add median-time-past calculation to CheckPoint
author志宇 <hello@evanlinjin.me>
Thu, 18 Sep 2025 02:06:03 +0000 (02:06 +0000)
committer志宇 <hello@evanlinjin.me>
Sat, 24 Jan 2026 15:03:03 +0000 (15:03 +0000)
commitb6235360e7232ad8bba2b12049eacdd2a6f9b3ca
tree413fd9e18243b12f3009567ec8efc5d1d59b098a
parent417ec634da5b96f053880044a61abed2f671268c
feat(core): add median-time-past calculation to CheckPoint

Add MTP calculation methods for CheckPoint following Bitcoin's BIP113:
- `median_time_past()`: calculates MTP for current block using 11 blocks
  starting from the current block
- Returns None when required blocks are missing

Includes comprehensive tests for all edge cases.
crates/core/src/checkpoint.rs
crates/core/tests/test_checkpoint.rs