bitcoindevkit / bitcoindevkit/bdk

Update Balance immature category calculation to consider MTP-based maturity

Open
#2,040 3 comments 1 reaction 0 assignees View on GitHub
Dominant language
Rust
Stars
1.1k
Forks
483
Avg merge
20d 3h
Merged PRs (30d)
3

Description

## Background
As noted in [PR #2037 review](https://github.com/bitcoindevkit/bdk/pull/2037#pullrequestreview-3242494265), the `Balance` immature category calculation could be enhanced to consider transaction maturity based on both Locktime and Median Time Past (MTP).

## Prerequisites
- Wait for [PR #2029](https://github.com/bitcoindevkit/bdk/pull/2029) to be merged first (simplifies API surface)
- PR #2037 should be merged (adds MTP calculation to CheckPoint)

## Task
Update the `Balance` struct's immature category calculation to properly consider transaction maturity using:
1. Transaction locktime
2. Median Time Past (MTP) from the CheckPoint

## Implementation Notes
- The MTP calculation is now available in `CheckPoint` (added in PR #2037)
- Should integrate with the simplified API from PR #2029
- Ensure proper testing with various locktime scenarios

## Acceptance Criteria
- [ ] Balance immature category correctly identifies transactions that are locked by time
- [ ] MTP is properly used for time-based locktime comparisons
- [ ] Existing tests pass
- [ ] New tests added for MTP-based maturity checks

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.