Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #! /usr/bin/python3
- from peercoin_rpc import Client
- number_of_blocks = 100
- ppcnode = Client(testnet=True, username="testnet", password="testnetpw", ip="localhost", port=8888)
- last_block_hash = ppcnode.getblockhash(ppcnode.getblockcount())
- block_versions = []
- for i in range(0, number_of_blocks):
- block = ppcnode.getblock(last_block_hash)
- last_block_hash = block['previousblockhash']
- block_versions.append(block['version'])
- fork_perc = block_versions.count(2) * 100 / number_of_blocks
- print(fork_perc)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement