Skip to content

feat(chain): add ChainPosition::blocks_since_conf - #2263

Open
Dmenec wants to merge 1 commit into
bitcoindevkit:masterfrom
Dmenec:feat/chain-position-blocks-since-conf
Open

feat(chain): add ChainPosition::blocks_since_conf#2263
Dmenec wants to merge 1 commit into
bitcoindevkit:masterfrom
Dmenec:feat/chain-position-blocks-since-conf

Conversation

@Dmenec

@Dmenec Dmenec commented Aug 20, 2026

Copy link
Copy Markdown
Contributor

Suggested by @nymius in #2246 (comment).

Description

Adds ChainPosition::blocks_since_conf(tip), which returns the number of blocks mined on top of a confirmed position's block, given the chain tip. Returns None if the position is unconfirmed, or if the confirmation height is above tip.

Changelog notice

  • Added ChainPosition::blocks_since_conf, returning the number of blocks mined on top of a confirmed position's block given the chain tip.

Checklists

All Submissions:

New Features:

  • I've added tests for the new feature
  • I've added docs for the new feature

@codecov

codecov Bot commented Aug 20, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 78.41%. Comparing base (456f9b7) to head (defff8e).

Additional details and impacted files
@@            Coverage Diff             @@
##           master    #2263      +/-   ##
==========================================
+ Coverage   78.36%   78.41%   +0.04%     
==========================================
  Files          30       30              
  Lines        5945     5952       +7     
  Branches      281      282       +1     
==========================================
+ Hits         4659     4667       +8     
+ Misses       1210     1209       -1     
  Partials       76       76              
Flag Coverage Δ
rust 78.41% <100.00%> (+0.04%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: No status

Development

Successfully merging this pull request may close these issues.

1 participant