Skip to content

relay broadcast transactions to peers#1026

Open
josibake wants to merge 1 commit into
libbitcoin:masterfrom
josibake:relay-broadcast-transactions
Open

relay broadcast transactions to peers#1026
josibake wants to merge 1 commit into
libbitcoin:masterfrom
josibake:relay-broadcast-transactions

Conversation

@josibake
Copy link
Copy Markdown
Contributor

@josibake josibake commented Jun 3, 2026

subscribe the outbound transaction protocol to locally broadcast transaction messages and announce them through the existing inv path.

the handler preserves the existing was_announced/null-hash behavior and avoids echoing a transaction back to the channel that originated the broadcast.

added to support broadcast from sparrow wallet; discovered while testing the silent payments index PRs.

subscribe the outbound transaction protocol to locally broadcast
transaction messages and announce them through the existing inv path.

the handler preserves the existing was_announced/null-hash behavior and
avoids echoing a transaction back to the channel that originated the
broadcast.

added to support broadcast from sparrow wallet; discovered while testing
the silent payments index PRs.
if (sender == identifier())
return true;

if (!message || !message->transaction_ptr)
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

This constitutes fault suppression, as it implies a contract failure that remains unexposed. This could be an assertion, as it should abort the process, and the assertion makes the failure easier to identify and documents the intent. However without the assertion the failure will occur as well.

This is such a common condition we don’t generally bother to assert for it. While some would consider the suppression good defensive programming, really it just condones a bug somewhere else. If this was public API surface the approach would be different, but this is internal communication under contract.

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