-
Notifications
You must be signed in to change notification settings - Fork 185
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
query: end completed queries in sendTransaction
(*ChainService).sendTransaction always timed out even if each peer did respond. This is because after receiving a getdata message in response to the outgoing inv, the checkResponse closure provided to queryAllPeers neglected to close the peerQuit channel. As a result, sendTransaction always blocks for the full configured BroadcastTimeout. This change adds the missing close(peerQuit) when a matching response (either a getdata or reject) is received. Note that as before this change, a non-nil error from sendTransaction does not guarantee that a remote peer actually received the MsgTx that was queued since the outgoing tx message is handled asynchronously. To account for the removed delay, the TestNeutrinoSync unit test is updated with a waitTx helper to ensure the mining node has the sent transaction prior to requesting a new block.
- Loading branch information
Showing
2 changed files
with
39 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters