Skip to content

Instantly share code, notes, and snippets.

@narcelio

narcelio/list_wit.py

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