lib/bitcoin/protocol/aux_pow.rb
# Coinbase transaction of the parent block, linking to the child block
Coinbase transaction of the parent block, linking to the child block
Coinbase transaction of the parent block linking to the child block
def parse_data_from_io(data)
        @coinbase_tx = P::Tx.new(nil)
        @coinbase_tx.parse_data_from_io(data)
        @block_hash = data.read(32)
        coinbase_branch_count = P.unpack_var_int_from_io(data)
        @coinbase_branch = []
        coinbase_branch_count.times do
          break if data.eof?
          @coinbase_branch << data.read(32).reverse.hth
        end
        @coinbase_index = data.read(4).unpack('I')[0]
        @chain_branch = []
        chain_branch_count = P.unpack_var_int_from_io(data)
        chain_branch_count.times do
          break if data.eof?
          @chain_branch << data.read(32).reverse.hth
        end
        @chain_index = data.read(4).unpack('I')[0]
        block = data.read(80)
        @parent_block = P::Block.new(block)
        data
      end
def parse_data_from_io ( data ) @coinbase_tx = P :: Tx . new ( nil ) @coinbase_tx . parse_data_from_io ( data ) @block_hash = data . read ( 32 ) coinbase_branch_count = P . unpack_var_int_from_io ( data ) @coinbase_branch = [ ] coinbase_branch_count . times do break if data . eof? @coinbase_branch << data . read ( 32 ) . reverse . hth end @coinbase_index = data . read ( 4 ) . unpack ( 'I' ) [ 0 ] @chain_branch = [ ] chain_branch_count = P . unpack_var_int_from_io ( data ) chain_branch_count . times do break if data . eof? @chain_branch << data . read ( 32 ) . reverse . hth end @chain_index = data . read ( 4 ) . unpack ( 'I' ) [ 0 ] block = data . read ( 80 ) @parent_block = P :: Block . new ( block ) data end
Coinbase transaction of the parent block, linking to the child block
Coinbase transaction of the parent block linking to the child block
data
<not_specific>