mirror of
https://gitlab.com/pulsechaincom/erigon-pulse.git
synced 2025-01-19 00:54:12 +00:00
non blocking broadcast of new txs (#292)
This commit is contained in:
parent
1cc07746a4
commit
74d49a9de1
@ -1324,7 +1324,9 @@ func MainLoop(ctx context.Context, db kv.RwDB, coreDB kv.RoDB, p *TxPool, newTxs
|
||||
log.Debug("[txpool] Commit", "written_kb", written/1024, "in", time.Since(t))
|
||||
}
|
||||
case h := <-newTxs:
|
||||
go func() {
|
||||
t := time.Now()
|
||||
|
||||
notifyMiningAboutNewSlots()
|
||||
localTxHashes = localTxHashes[:0]
|
||||
localTxRlps = localTxRlps[:0]
|
||||
@ -1368,6 +1370,7 @@ func MainLoop(ctx context.Context, db kv.RwDB, coreDB kv.RoDB, p *TxPool, newTxs
|
||||
send.BroadcastPooledTxs(remoteTxRlps)
|
||||
send.AnnouncePooledTxs(remoteTxHashes)
|
||||
propagateNewTxsTimer.UpdateDuration(t)
|
||||
}()
|
||||
case <-syncToNewPeersEvery.C: // new peer
|
||||
newPeers := p.recentlyConnectedPeers.GetAndClean()
|
||||
if len(newPeers) == 0 {
|
||||
|
Loading…
Reference in New Issue
Block a user