Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix broadcast timeout #241

Closed
wants to merge 2 commits into from

Conversation

achow101
Copy link

@achow101 achow101 commented Jun 1, 2017

This fixes the problem where users would receive a "tx broadcast timed out (get)" error.

Asking the transaction back from the node is unreliable since the node will not relay a transaction back to the node that sent it. In order for the transaction to be received back, it must have relayed it to the other nodes it is connected to.

This PR replaces that mechanism entirely. Instead of asking for the transaction back, we send a ping and wait for a pong. If a reject is received before a pong, the transaction is bad and was not broadcast. If we receive a pong, then the transaction was good and was successfully sent to the node.

Users who run nodes with a large amount of connections (like myself) were unlikely to experience the original error since there is a higher probability that the transaction would be relayed to other nodes by the time it was requested for again by Armory.

The original transaction send check depended on the node relaying the transaction
back to Armory. However this behavior is not guaranteed and, due to changes in Core,
almost never happens.

The only guaranteed thing that will happen is that if the transaction is rejected for
any reason, a reject message will be sent. If no reject message is received and the connection
remains open and the node responsive, then the transaction was successfully sent.

The transaction send check mechanism has been replaced with one that waits for a reject, and
if it does not receive one, it will test the connection with a ping-pong.
@achow101
Copy link
Author

achow101 commented Jul 2, 2017

Superseeded by 42a7ff4

@achow101 achow101 closed this Jul 2, 2017
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.

None yet

1 participant