4

I am performing a transaction to send an ERC20 and I keep getting this error:

ValueError: {'code': -32000, 'message': 'already known'}

I'm assuming this means that this transaction is already in the mempool or something? Looking for some clarifications though.

Patrick Collins
  • 11,186
  • 5
  • 44
  • 97

2 Answers2

3

Partial answer...

I'm assuming this means that this transaction is already in the mempool or something?

Yes. From tx_pool.go:

// ErrAlreadyKnown is returned if the transactions is already contained
// within the pool.
ErrAlreadyKnown = errors.New("already known")

But it's not immediately clear from the code what conditions have to be met for this error to be set, so it's difficult to suggest a solution.

Richard Horrocks
  • 37,835
  • 13
  • 87
  • 144
0

I was getting this error using github.com/ethereum/go-ethereum

First, make sure you are using the right nonce in the tx

nonce, err := client.PendingNonceAt(context, someAddress)

Then, make sure you are passing the right context to all your methods, including the one above