From 43db8d098f74f0f8c76618c216feb1abed6ad247 Mon Sep 17 00:00:00 2001 From: Callum Waters Date: Fri, 22 Sep 2023 09:38:01 +0200 Subject: [PATCH] feat: mempool v1 records which peer it has sent the tx (#1089) This PR records that we have sent the peer the transaction to avoid doing it a second time --- mempool/v1/reactor.go | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/mempool/v1/reactor.go b/mempool/v1/reactor.go index eb80e4509a..3741e7df3c 100644 --- a/mempool/v1/reactor.go +++ b/mempool/v1/reactor.go @@ -269,6 +269,10 @@ func (memR *Reactor) broadcastTxRoutine(peer p2p.Peer) { if !success { time.Sleep(mempool.PeerCatchupSleepIntervalMS * time.Millisecond) continue + } else { + // record that we have sent the peer the transaction + // to avoid doing it a second time + memTx.SetPeer(peerID) } }