Skip to content

Commit

Permalink
Remove not needed sender set and set it if not set from the outside
Browse files Browse the repository at this point in the history
  • Loading branch information
Stefan-Ethernal committed Aug 9, 2023
1 parent c77c066 commit e4242e6
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions txrelayer/txrelayer.go
Original file line number Diff line number Diff line change
Expand Up @@ -101,15 +101,15 @@ func (t *TxRelayerImpl) sendTransactionLocked(txn *ethgo.Transaction, key ethgo.
t.lock.Lock()
defer t.lock.Unlock()

txn.From = key.Address()

nonce, err := t.client.Eth().GetNonce(key.Address(), ethgo.Pending)
if err != nil {
return ethgo.ZeroHash, fmt.Errorf("failed to get nonce: %w", err)
}

txn.Nonce = nonce
txn.From = key.Address()
if txn.From == ethgo.ZeroAddress {
txn.From = key.Address()
}

if txn.Type != ethgo.TransactionDynamicFee && txn.GasPrice == 0 {
gasPrice, err := t.Client().Eth().GasPrice()
Expand Down

0 comments on commit e4242e6

Please sign in to comment.