ethereumjs / ethereumjs-tx

Project is in active development and has been moved to the EthereumJS VM monorepo.
https://github.com/ethereumjs/ethereumjs-vm/tree/master/packages/tx
Mozilla Public License 2.0
779 stars 235 forks source link

Exception when sending a signed transaction #89

Closed woniesong92 closed 6 years ago

woniesong92 commented 6 years ago

x-posting from https://stackoverflow.com/questions/48838899/sending-signed-transactions-to-ropsten/48839444#48839444

When I get the nonce from my account and sign a transaction, I get the following exception. Is there anything obvious that I'm missing here?

let nonce
web3.eth.getTransactionCount(account).then(_nonce => {
  nonce = _nonce.toString(16)
})

const txParams = {
  gasPrice: '0x' + gasPrice,
  to: CONTRACT_ADDRESS,
  data: functionAbi,
  from: account,
  nonce: '0x' + nonce,
}

Unhandled rejection Error: Returned error: rlp: input string too long for uint64, decoding into (types.Transaction)(types.txdata).AccountNonce
woniesong92 commented 6 years ago

This was because I was trying to overwrite an existing transaction with the same nonce.