Skip to content

Update immature_transactions() to return HashSet<Txid> and spent_outpoints rebuild to use input_details #71

@xdustinface

Description

@xdustinface

Context

immature_transactions() returns Vec<Transaction> but every caller only uses .txid(), .len(), or .is_empty(). The spent_outpoints rebuild on deserialization iterates record.transaction.input — with input_details available, it can use those instead.

Parent: #68

Acceptance Criteria

  • immature_transactions() returns HashSet<Txid> instead of Vec<Transaction>
  • All callers updated (dash-spv tests, key-wallet tests, wallet_checker tests)
  • spent_outpoints rebuild on deserialization uses record.input_details (OutPoint from transaction.input[detail.index].previous_output) instead of iterating all tx inputs
  • Tests pass, cargo clippy clean

Notes

  • Depends on Add InputDetail, OutputDetail, TransactionDirection to TransactionRecord #69 (input_details must exist in TransactionRecord)
  • immature_transactions() in wallet_info_interface.rs finds immature coinbase UTXOs and collects their txids — the Transaction was never needed
  • spent_outpoints rebuild in managed_account/mod.rs deserialization: currently record.transaction.input.iter().map(|i| i.previous_output) — change to record.input_details.iter().map(|d| record.transaction.input[d.index].previous_output)
  • Files: key-wallet/src/wallet/managed_wallet_info/wallet_info_interface.rs, key-wallet/src/managed_account/mod.rs, dash-spv/tests/dashd_sync/setup.rs, key-wallet/tests/spv_integration_tests.rs

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions