From bb87df0afad3a3a804f9089e9a100ba8fafeb4e5 Mon Sep 17 00:00:00 2001 From: "alex.sharov" Date: Sat, 14 Aug 2021 15:40:10 +0700 Subject: [PATCH] remove statusData from fetch --- txpool/fetch.go | 8 ++------ txpool/pool.go | 7 +------ 2 files changed, 3 insertions(+), 12 deletions(-) diff --git a/txpool/fetch.go b/txpool/fetch.go index 39555d7e1..be5c369ac 100644 --- a/txpool/fetch.go +++ b/txpool/fetch.go @@ -49,15 +49,11 @@ type Fetch struct { } type Timings struct { - propagateAllNewTxsEvery time.Duration - syncToNewPeersEvery time.Duration - broadcastLocalTransactionsEvery time.Duration + syncToNewPeersEvery time.Duration } var DefaultTimings = Timings{ - propagateAllNewTxsEvery: 5 * time.Second, - broadcastLocalTransactionsEvery: 2 * time.Minute, - syncToNewPeersEvery: 2 * time.Minute, + syncToNewPeersEvery: 2 * time.Minute, } // NewFetch creates a new fetch object that will work with given sentry clients. Since the diff --git a/txpool/pool.go b/txpool/pool.go index ba661f7bd..f5047c158 100644 --- a/txpool/pool.go +++ b/txpool/pool.go @@ -837,15 +837,9 @@ func (p *WorstQueue) Pop() interface{} { // promote/demote transactions // reorgs func BroadcastLoop(ctx context.Context, p *TxPool, newTxs chan Hashes, send *Send, timings Timings) { - propagateAllNewTxsEvery := time.NewTicker(timings.propagateAllNewTxsEvery) - defer propagateAllNewTxsEvery.Stop() - syncToNewPeersEvery := time.NewTicker(timings.syncToNewPeersEvery) defer syncToNewPeersEvery.Stop() - broadcastLocalTransactionsEvery := time.NewTicker(timings.broadcastLocalTransactionsEvery) - defer broadcastLocalTransactionsEvery.Stop() - localTxHashes := make([]byte, 0, 128) remoteTxHashes := make([]byte, 0, 128) @@ -879,6 +873,7 @@ func BroadcastLoop(ctx context.Context, p *TxPool, newTxs chan Hashes, send *Sen } } +// commitIsLocalHistory - use u64 sequence as keys to preserve order func commitIsLocalHistory(db kv.RwDB, commited time.Time, localsHistory *simplelru.LRU) error { if db == nil || time.Since(commited) < 30*time.Second { return nil