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 to_payload
        payload = @coinbase_tx.to_payload
        payload << @block_hash
        payload << P.pack_var_int(@coinbase_branch.count)
        payload << @coinbase_branch.map(&:htb).map(&:reverse).join
        payload << [@coinbase_index].pack('I')
        payload << P.pack_var_int(@chain_branch.count)
        payload << @chain_branch.map(&:htb).map(&:reverse).join
        payload << [@chain_index].pack('I')
        payload << @parent_block.to_payload
        payload
      end
def to_payload payload = @coinbase_tx . to_payload payload << @block_hash payload << P . pack_var_int ( @coinbase_branch . count ) payload << @coinbase_branch . map ( & :htb ) . map ( & :reverse ) . join payload << [ @coinbase_index ] . pack ( 'I' ) payload << P . pack_var_int ( @chain_branch . count ) payload << @chain_branch . map ( & :htb ) . map ( & :reverse ) . join payload << [ @chain_index ] . pack ( 'I' ) payload << @parent_block . to_payload payload end
Coinbase transaction of the parent block, linking to the child block
Coinbase transaction of the parent block linking to the child block