remove statusData from fetch

This commit is contained in:
alex.sharov 2021-08-14 15:40:10 +07:00
parent 002c671961
commit bb87df0afa
2 changed files with 3 additions and 12 deletions

View File

@ -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

View File

@ -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