Fix broadcasting to a peer who already has tx#556
Fix broadcasting to a peer who already has tx#556randomlogin wants to merge 1 commit into2140-dev:masterfrom
Conversation
|
This is by design. There is a possibility the first peer simply drops the |
What if we ask the same peer for the tx we've just broadcast? Of course, it doesn't mean it has propagated further, but we know that the broadcast succeeded? And also to have a fallback with timeout? |
|
Is there a deep purpose of |
ee23540 to
dbd0be9
Compare
|
I should not have squashed commits in this PR yet. |
|
I think this PR may be closed, it was just a surprising behaviour to me in comparison to how other things broadcast txs, now it seems it is a valid design decision. Not sure about builder method or explicit timeout argument, is it needed or not? |
|
The only way to evaluate if a transaction is in a miner's memory pool is by heuristics, as we don't know if the transaction propagates beyond our peers. I think the intuition that we can improve broadcasting is correct. For instance, in Bitcoin Core's private broadcast feature, a transaction is advertised to peer A, and we wait for any other connection to broadcast the |
Previously if we broadcast to a peer who already has the tx it would hang indefinetely, as there is no subsequent getdata message.