Skip to content

fix(chain): return TxNode from CanonicalIter#2142

Closed
shubham-shinde-442 wants to merge 1 commit intobitcoindevkit:masterfrom
shubham-shinde-442:fix/chain-canonical-iter-return-txnode
Closed

fix(chain): return TxNode from CanonicalIter#2142
shubham-shinde-442 wants to merge 1 commit intobitcoindevkit:masterfrom
shubham-shinde-442:fix/chain-canonical-iter-return-txnode

Conversation

@shubham-shinde-442
Copy link

Fixes: #2051

Description

This patch implements a TODO comment to have CanonicalIter return TxNode directly instead of just (Txid, Arc). This eliminates a redundant lookup in CanonicalView::new that was fetching the same transaction node data twice.

  • Modified CanonicalIter to return TxNode<'g, Arc, A> instead of (Txid, Arc) in its iterator item type
  • Simplified CanonicalView::new by removing redundant tx_graph.get_tx_node(txid) lookup and TODO comment
  • Added integration test test_canonical_view_construction_with_tx_nodes to verify the change

Changelog notice

All Submissions:

Bugfixes:

  • This pull request breaks the existing API
  • I've added tests to reproduce the issue which are now passing
  • I'm linking the issue being fixed by this PR

@evanlinjin
Copy link
Member

Thanks for the attempt, but this is no longer needed as we will remove CanonicalIter in #2038.

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

Labels

None yet

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

The CanonicalIter should return the TxNode's.

2 participants