Created
July 25, 2016 22:15
-
-
Save larspensjo/24d1c76107a2fb05000ef5a8b91a1801 to your computer and use it in GitHub Desktop.
Find all transactions for an account.
This file contains 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
function FindAccountTransactions(start, end) { | |
find = "0x304a554a310c7e546dfe434669c62820b7d83490"; | |
// find = "0x80a103beced8a6854a7a82ac2d48cdab0eb21cc0"; | |
total = 0; | |
found = ""; | |
for (bn = start; bn < end; bn++) { | |
block = eth.getBlock(bn); | |
transList = block.transactions; | |
total += transList.length; | |
for (i = 0; i < transList.length; i++) { | |
trans = eth.getTransaction(transList[i]); | |
if (trans.from == find) { | |
found += transList[i] + " "; | |
console.log(transList[i]); | |
} | |
} | |
if (bn % 100 == 0) { | |
console.log(bn, total); | |
total = 0; | |
} | |
} | |
console.log(found); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment