Last active
August 29, 2015 14:22
-
-
Save tgerring/bd267e641e6fba63a126 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// This is free and unencumbered software released into the public domain. | |
// | |
// Paste this function into the JavaScript console and execute like so: | |
// sendLots(eth.coinbase, eth.accounts[1]) | |
// This can be saved to a file and loaded with loadScript('/path/to/sendLots.js') | |
sendLots = function(fromAccount, toAccount) { | |
loops = 5; | |
txcount = 2; | |
waitBlocks = 1; | |
i = 0; | |
do { | |
i++; | |
j = 0; | |
do { | |
j++; | |
//customize the transaction here | |
wei = (i-1)*10+j; | |
tx = eth.sendTransaction({from: fromAccount, to: toAccount, value: wei}); | |
console.log("tx"+j+": "+tx+" for "+wei+" wei"); | |
} while (j < txcount) | |
if (i != loops) { | |
console.log(i+": Waiting "+waitBlocks+" block for "+(eth.blockNumber+waitBlocks)); | |
admin.debug.waitForBlocks(eth.blockNumber-1+waitBlocks); // This seems off | |
} else { | |
console.log(i+": Next block is "+(eth.blockNumber+waitBlocks)+"... wait for it :)") | |
} | |
} while (i < loops) | |
return | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Something not right I get unexpected token ILLEGAL ( and 3 more errors)
Or if input it line by line when I get to } while (i < loops); if crashes out with Line23:1 Unexpected end of input