bitcoin core – What’s up with the block dimension of block# 295182?

0
40


I discovered an anomaly within the block dimension information: block 295182. This one appears to have a approach increased payload. What occurred there?


Or is that this there one thing improper with my parsing? This file block does seem like on the finish of a .dat file.

Here is the code I used:

import struct
import matplotlib.pyplot as plt

blockchain_path="mypath/blocks"

def get_block_path(index):
    file="blk" + str(index).zfill(5) + '.dat'
    return blockchain_path + "https://bitcoin.stackexchange.com/" + file

def plot(x, y, title, xlabel, ylabel):
    plt.scatter(x, y)
    plt.suptitle(title, fontsize=20)
    plt.xlabel(xlabel)
    plt.ylabel(ylabel)
    plt.present()

def uint4(stream):
    return struct.unpack('I', stream.learn(4))[0]

def blocks_remaining(f, i):
    cur = f.inform()
    attempt:
        uint4(f)
        f.search(cur)
        return True
    besides:
        print("Finish of file: blk" + str(i).zfill(5) + '.dat')
        return False

BlockHeight, BlockSize = ([] for i in vary(2))
cur_block_height = -1


for i in vary(0, 100):
    block_path = get_block_path(i)
    #stick with single file
    f = open(block_path, 'rb', buffering=16 * 1024 * 1024)
  

  #loop blocks in file
    whereas blocks_remaining(f, i):
        cur_block_height += 1
        magic_num = uint4(f)
        block_size = uint4(f)

        print(cur_block_height, f.inform(), magic_num, block_size)

        #append information
        BlockHeight.append(cur_block_height)
        BlockSize.append(block_size)

        #skip to subsequent block
        f.learn(block_size)

plot(BlockHeight, BlockSize, 'Block Measurement', 'block peak', 'bytes')



Supply hyperlink

Leave a reply