Skip to content

fix: match spent Bitcoin outputs by outpoint - #3492

Draft
tantshirt wants to merge 1 commit into
cake-tech:devfrom
tantshirt:agent/fix-silent-payment-outpoint-cleanup
Draft

fix: match spent Bitcoin outputs by outpoint#3492
tantshirt wants to merge 1 commit into
cake-tech:devfrom
tantshirt:agent/fix-silent-payment-outpoint-cleanup

Conversation

@tantshirt

Copy link
Copy Markdown

Issue Number (if Applicable): Fixes #3176

Description

Bitcoin post-send cleanup removed unspents by transaction hash alone. When a transaction contained multiple wallet-owned outputs, spending one output could also remove its still-unspent sibling from cached transaction history and the in-memory unspent list.

This changes both cleanup paths to identify spent outputs by the complete outpoint: transaction hash and output index. A focused cw_bitcoin unit test covers exact matches, sibling outputs from the same transaction, and matching output indexes from different transactions.

Validation

  • flutter test --no-pub test/bitcoin_unspent_test.dart
  • flutter test --no-pub (12 tests)
  • flutter analyze --no-pub test/bitcoin_unspent_test.dart

Pull Request - Checklist

  • Initial Manual Tests Passed
  • Double check modified code and verify it with the feature/task requirements
  • Format code
  • Look for code duplication
  • Clear naming for variables and methods
  • Manual tests in accessibility mode (TalkBack on Android) passed

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Silent Payment spend cleanup matches by txid only and may drop sibling unspent outputs

1 participant