Commit f21f6a20 authored by Felipe Andrade's avatar Felipe Andrade

add cooldown

parent 8d8597a2
......@@ -58,6 +58,16 @@ func (p *Provider) RoundTrip(ctx context.Context) {
// used for actual round trip time (disregard retry time)
roundTripStartedAt := time.Now()
for {
// sleep until we get a clear to send
for {
coolDown := time.Duration(p.config.SendTransactionCoolDown) - time.Since(p.txPool.LastSend)
if coolDown > 0 {
time.Sleep(coolDown)
} else {
break
}
}
tx := p.createTx(nonce)
txHash = tx.Hash()
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment