Skip to content

Instantly share code, notes, and snippets.

@tonymorony
Last active November 15, 2019 09:24
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save tonymorony/d3252f44e522ee996f051abcec7f22af to your computer and use it in GitHub Desktop.
Save tonymorony/d3252f44e522ee996f051abcec7f22af to your computer and use it in GitHub Desktop.
from slickrpc import Proxy
rpc = Proxy("http://%s:%s@127.0.0.1:%d"%("rpcuser", "rpcpassword", 7771))
current_height = rpc.getinfo()["longestchain"]
needed_txs = []
while (current_height > 0):
block_txs_list = rpc.getblock(str(current_height))["tx"]
for tx_id in block_txs_list:
tx_info = rpc.getrawtransaction(tx_id, 1)
blocktime = tx_info["blocktime"]
locktime = tx_info["locktime"]
if locktime > blocktime:
print("found tx: " + tx_id)
needed_txs.append(tx_id)
current_height = current_height - 1
if (current_height % 100000 == 0):
print("Scanning on " + str(current_height) + " height")
print("Scanning completed:")
print(needed_txs)
with open('tx_list.txt', 'w+') as f:
for transaction in needed_txs:
f.write("%s\n" % transaction)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment