Skip to content

Instantly share code, notes, and snippets.

@narcelio
Last active August 18, 2017 21:46
Show Gist options
  • Save narcelio/efc8e7bd631ae0dccd7e985a2fd0e8af to your computer and use it in GitHub Desktop.
Save narcelio/efc8e7bd631ae0dccd7e985a2fd0e8af to your computer and use it in GitHub Desktop.
#!/usr/bin/env python3
# pip3 install python-bitcoinlib
import bitcoin.rpc
import re
node = bitcoin.rpc.Proxy()
for height in range(480000, node.getblockcount()):
block_hash = node.getblockhash(height)
block = node.getblock(block_hash)
coinbase = block.vtx[0]
txin = coinbase.vin[0]
sig = txin.scriptSig
b = re.sub(rb'[^\x20-\x7e]',rb'', sig)
s = b.decode()
if 'Minerworld' in s:
print('Bloco minerado pela Minerworld:', height)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment