Skip to content

fix(wallet): map keychain in mark_used and unmark_used#507

Open
evanlinjin wants to merge 1 commit into
bitcoindevkit:masterfrom
evanlinjin:fix/mark_unused
Open

fix(wallet): map keychain in mark_used and unmark_used#507
evanlinjin wants to merge 1 commit into
bitcoindevkit:masterfrom
evanlinjin:fix/mark_unused

Conversation

@evanlinjin

@evanlinjin evanlinjin commented Jun 27, 2026

Copy link
Copy Markdown
Member

Description

The bug that is fixed: Wallet::mark_used and Wallet::unmark_used passed the caller-supplied KeychainKind straight through to the underlying index. For single-descriptor wallets, this meant marking or unmarking an index on KeychainKind::Internal was a silent no-op.

Changelog notice

- Fixed `Wallet::mark_used` and `Wallet::unmark_used` being a no-op on single-descriptor wallets when passed `KeychainKind::Internal`.

Before submitting

`mark_used` and `unmark_used` passed the caller-supplied `KeychainKind`
straight to the index. For single-descriptor wallets, this meant marking
or unmarking an index on `Internal` was a no-op, since that wallet only
tracks the `External` keychain.

Route the keychain through `map_keychain` first, consistent with the
other methods that take a `KeychainKind`, so a single-keychain wallet
resolves `Internal` to `External`.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@codecov

codecov Bot commented Jun 27, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 80.97%. Comparing base (58fe631) to head (eb5f5b5).

Additional details and impacted files
@@            Coverage Diff             @@
##           master     #507      +/-   ##
==========================================
+ Coverage   80.96%   80.97%   +0.01%     
==========================================
  Files          24       24              
  Lines        5489     5493       +4     
  Branches      247      247              
==========================================
+ Hits         4444     4448       +4     
  Misses        968      968              
  Partials       77       77              
Flag Coverage Δ
rust 80.97% <100.00%> (+0.01%) ⬆️

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.

@evanlinjin evanlinjin self-assigned this Jun 27, 2026
@evanlinjin evanlinjin added the bug Something isn't working label Jun 27, 2026
@evanlinjin evanlinjin marked this pull request as ready for review June 27, 2026 07:58
@110CodingP 110CodingP added this to the Wallet 3.2.0 milestone Jun 30, 2026

@noahjoeris noahjoeris left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ACK eb5f5b5

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

Labels

bug Something isn't working

Projects

Status: No status

Development

Successfully merging this pull request may close these issues.

3 participants