mirror of
https://gitlab.com/pulsechaincom/erigon-pulse.git
synced 2025-01-01 00:31:21 +00:00
remove statusData from fetch
This commit is contained in:
parent
002c671961
commit
bb87df0afa
@ -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
|
||||
|
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user