I have an issue with transactions on my local ethereum network - at some point, transaction hangs & spends a lot of ETH from my account.
Here's a sample code:
async function send(toAccount, weiVal) {
let account = await w3.getDefAccount();
for (let i = 0; i < 100; i++) {
let res = await web3.eth.sendTransaction({
from: account,
to: toAccount,
value: weiVal
});
await helper.timeout(2000);
}
}
send('0x5648...', 100000000000000);
It hangs at sendTransaction call (promise is never resolved) on some random iteration.