send mutex

This commit is contained in:
Felipe Andrade 2023-09-06 15:15:19 -07:00
parent c7c9a52850
commit 5d8d892185
2 changed files with 5 additions and 0 deletions

@ -34,6 +34,9 @@ func (p *Provider) RoundTrip(ctx context.Context) {
return
}
p.txPool.ExclusiveSend.Lock()
defer p.txPool.ExclusiveSend.Unlock()
txHash := common.Hash{}
attempt := 0
nonce := uint64(0)

@ -18,6 +18,8 @@ type NetworkTransactionPool struct {
// Last time a transaction was sent
LastSend time.Time
// Prevents concurrent transaction send
ExclusiveSend sync.Mutex
}
type TransactionState struct {