Skip to content

Fix(core): Fix TxOutIter::size_hint to use output count - #215

Merged
sedited merged 2 commits into
sedited:masterfrom
alexanderwiederin:fix-output-size-hint
Aug 25, 2026
Merged

Fix(core): Fix TxOutIter::size_hint to use output count#215
sedited merged 2 commits into
sedited:masterfrom
alexanderwiederin:fix-output-size-hint

Conversation

@alexanderwiederin

@alexanderwiederin alexanderwiederin commented Aug 14, 2026

Copy link
Copy Markdown
Collaborator

Summary

TxOutIter::size_hint computed its remaining count from input_count() rather than output_count(), so on any transaction where the two differ it reported the wrong number of remaining items.

Why this wasn't caught

Neither iterator had any coverage of size_hint or len. The existing test_transaction_outputs_iterator drives a manual for loop with a hand-rolled counter, which only exercises next(), so the hint was invisible to the suite.

@alexanderwiederin
alexanderwiederin force-pushed the fix-output-size-hint branch 3 times, most recently from 1657716 to 6e73cd3 Compare August 14, 2026 12:25
@alexanderwiederin
alexanderwiederin marked this pull request as ready for review August 14, 2026 12:31
@alexanderwiederin alexanderwiederin changed the title Fix output size hint Fix(core): Fix TxOutIter::size_hint to use output count Aug 14, 2026

@sedited sedited left a comment

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

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

Uff, nice catch.

LGTM

@sedited

sedited commented Aug 25, 2026

Copy link
Copy Markdown
Owner

This needs a rebase now.

@jaoleal jaoleal 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.

LGTM 6e73cd3

i can reack on rebase

@alexanderwiederin

Copy link
Copy Markdown
Collaborator Author

Rebased - thanks!

@jaoleal jaoleal 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 aec4a43

@sedited sedited left a comment

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

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

Will see that I can make a release tomorrow.

@sedited
sedited merged commit 54f297a into sedited:master Aug 25, 2026
16 checks 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.

3 participants