Skip to content

Commit

Permalink
Merge pull request #20762 from karalabe/fix-txprop-leak
Browse files Browse the repository at this point in the history
eth: fix transaction announce/broadcast goroutine leak
  • Loading branch information
karalabe authored Mar 14, 2020
2 parents 92f3405 + 270fbfb commit 68b4b74
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions eth/peer.go
Original file line number Diff line number Diff line change
Expand Up @@ -155,9 +155,9 @@ func (p *peer) broadcastBlocks() {
// node internals and at the same time rate limits queued data.
func (p *peer) broadcastTransactions() {
var (
queue []common.Hash // Queue of hashes to broadcast as full transactions
done chan struct{} // Non-nil if background broadcaster is running
fail = make(chan error) // Channel used to receive network error
queue []common.Hash // Queue of hashes to broadcast as full transactions
done chan struct{} // Non-nil if background broadcaster is running
fail = make(chan error, 1) // Channel used to receive network error
)
for {
// If there's no in-flight broadcast running, check if a new one is needed
Expand Down Expand Up @@ -217,9 +217,9 @@ func (p *peer) broadcastTransactions() {
// node internals and at the same time rate limits queued data.
func (p *peer) announceTransactions() {
var (
queue []common.Hash // Queue of hashes to announce as transaction stubs
done chan struct{} // Non-nil if background announcer is running
fail = make(chan error) // Channel used to receive network error
queue []common.Hash // Queue of hashes to announce as transaction stubs
done chan struct{} // Non-nil if background announcer is running
fail = make(chan error, 1) // Channel used to receive network error
)
for {
// If there's no in-flight announce running, check if a new one is needed
Expand Down

0 comments on commit 68b4b74

Please sign in to comment.