Explore Courses Blog Tutorials Interview Questions
0 votes
in Blockchain by (12.7k points)

I know web3.eth.sendSignedTransaction() of web3js which is used to send transaction and in return gives us transaction hash. But when I want to make multiple transactions in a loop. It gives me errors like

1 - Transaction known

2 - duplicate transaction

3 - error

So how can I make multiple transactions for sending tokens which can run in a loop. The main problem causing this issue is nounce(transaction count of last mined transaction). The transaction is not mined and we give them multiple transaction hence we get same nounce results in getting all these errors. But there is some way of sending multiple transactions. Because when I do the same task in myetherwallet or metamask, it can send multiple transaction.


1 Answer

0 votes
by (29.5k points)
selected by
Best answer

I think you need to increment nonce with each transaction that you send also you need useweb3.eth.accounts.signTransaction not web3.eth.sendSignedTransaction

Browse Categories