Skip to content

Instantly share code, notes, and snippets.

@narcelio

narcelio/mw.py

Last active Aug 18, 2017
Embed
What would you like to do?
#!/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