Last active
November 15, 2019 09:24
-
-
Save tonymorony/d3252f44e522ee996f051abcec7f22af to your computer and use it in GitHub Desktop.
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
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