Skip to content

Instantly share code, notes, and snippets.

@narcelio
Created August 24, 2017 06:07
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save narcelio/20c76ebb921c91580ba1626bd03e432f to your computer and use it in GitHub Desktop.
Save narcelio/20c76ebb921c91580ba1626bd03e432f to your computer and use it in GitHub Desktop.
#!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# (c) Copyright 2017 by Narcelio Filho <narcelio@gmail.com>
# pip install git+https://github.com/petertodd/python-bitcoinlib
import bitcoin.rpc
import socket
node = bitcoin.rpc.Proxy()
i = 1
for height in range(481824, 481834+1):
block_hash = node.getblockhash(height)
block = node.getblock(block_hash)
for tx in block.vtx:
if tx.is_coinbase():
continue
if tx.has_witness():
print(i, tx.GetTxid()[::-1].hex())
i += 1
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment