Skip to content

Refactor transaction handling to ensure safe access. #271

Open
Ignacio-87 wants to merge 4 commits intodevfrom
change-get-transaction
Open

Refactor transaction handling to ensure safe access. #271
Ignacio-87 wants to merge 4 commits intodevfrom
change-get-transaction

Conversation

@Ignacio-87
Copy link
Contributor

@Ignacio-87 Ignacio-87 commented Feb 10, 2026

Summary

Updated coordinator changes: TransactionStatus has been extended with additional states: InMempool and NotFound, indicating that a transaction may be optional.

Related with others libs

Building with

override: rust-bitcoin-indexer: change-get-transaction
override: rust-bitvmx-transaction-monitor: improve-get-tx-status
override: rust-bitcoin-coordinator: change-get-transaction

…us usage

- Add IndexerError mapping in errors.rs using #[from] attribute
- Replace tx_status.tx unwrapping with tx_status.tx_or_err()? in multiple files:
  - dispute/tx_news.rs
  - union/accept_pegin.rs
  - union/advance_funds.rs
  - union/dispute_core.rs
  - cardinal/slot.rs
- Fix tx_id() method call to use tx.compute_txid() in slot.rs
- Replace block_info.unwrap() with block_info_or_err()? to fix ownership issues
- Add TransactionStuckInMempool pattern match in bitvmx.rs
- Replace tx_status.tx.unwrap() with tx_status.tx_or_err()? in lock.rs
- Update lockservice.rs example to match the new pattern
Copy link
Contributor

@jonasmartin jonasmartin left a comment

Choose a reason for hiding this comment

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

lgtm

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.

2 participants