0 votes
1 view
in Blockchain by (12.8k 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.

closed

1 Answer

0 votes
by (29.8k 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

Welcome to Intellipaat Community. Get your technical queries answered by top developers !


Categories

...