lib/bitcoin/builder.rb
# create the block according to values specified via DSL.
create the block according to values specified via DSL.
create the block according to values specified via DSL .
def block(target)
        @version ||= nil
        @mrkl_root ||= nil
        @time ||= nil
        @block.ver = @version || 1
        @block.prev_block = @prev_block.htb.reverse
        @block.mrkl_root = @mrkl_root
        @block.time = @time || Time.now.to_i
        @block.nonce = 0
        @block.mrkl_root = Bitcoin.hash_mrkl_tree(@block.tx.map(&:hash)).last.htb.reverse
        find_hash(target)
        block = P::Block.new(@block.to_payload)
        raise 'Payload Error' unless block.to_payload == @block.to_payload
        block
      end
def block ( target ) @version ||= nil @mrkl_root ||= nil @time ||= nil @block . ver = @version || 1 @block . prev_block = @prev_block . htb . reverse @block . mrkl_root = @mrkl_root @block . time = @time || Time . now . to_i @block . nonce = 0 @block . mrkl_root = Bitcoin . hash_mrkl_tree ( @block . tx . map ( & :hash ) ) . last . htb . reverse find_hash ( target ) block = P :: Block . new ( @block . to_payload ) raise 'Payload Error' unless block . to_payload == @block . to_payload block end
create the block according to values specified via DSL.
create the block according to values specified via DSL .
target
<not_specific>