Skip to content

fixed CanonicalReason::Assumed to check for direct anchor when no descendant exists#2110

Open
AayushGupta56 wants to merge 2 commits intobitcoindevkit:masterfrom
AayushGupta56:ChainPosition
Open

fixed CanonicalReason::Assumed to check for direct anchor when no descendant exists#2110
AayushGupta56 wants to merge 2 commits intobitcoindevkit:masterfrom
AayushGupta56:ChainPosition

Conversation

@AayushGupta56
Copy link

fixes #2088

Summary :- When a transaction is both in assume_canonical and has a direct anchor, it was incorrectly returned as ChainPosition::Unconfirmed. This fix adds a check for a direct anchor in the None descendant case, returning ChainPosition::Confirmed when an anchor exists.

@AayushGupta56
Copy link
Author

AayushGupta56 commented Feb 1, 2026

@ValuedMammal can you please review this ?
Should I also add the testcase you mentioned in the issue?
Although the issue was already assigned to someone else but the was no activity on this issue since 2 weeks, so I gave it a try 😅.

@AayushGupta56 AayushGupta56 changed the title fixed CanonicalReason::Assumed to check for direct anchor when no des… fixed CanonicalReason::Assumed to check for direct anchor when no descendant exists Feb 1, 2026
@evanlinjin
Copy link
Member

@AayushGupta56 thanks for the PR. Please add some tests!

@AayushGupta56
Copy link
Author

@AayushGupta56 thanks for the PR. Please add some tests!

added a test in test_canonical_view.rs

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.

CanonicalReason::Assumed should map to ChainPosition::Confirmed if a direct anchor exists

2 participants