lib/bitcoin/script.rb
# do a CHECKSIG operation on the current stack,
# asking +check_callback+ to do the actual signature verification.
# This is used by Protocol::Tx#verify_input_signature
do a CHECKSIG operation on the current stack,
asking +check_callback+ to do the actual signature verification.
This is used by Protocol::Tx#verify_input_signature
do a CHECKSIG operation on the current stack asking + check_callback + to do the actual signature verification . This is used by Protocol :: Tx#verify_input_signature
def op_checksig(check_callback, opts={})
    return invalid if @stack.size < 2
    pubkey = cast_to_string(@stack.pop)
    return (@stack << 0) unless Bitcoin::Script.check_pubkey_encoding?(pubkey, opts)
    drop_sigs      = [ cast_to_string(@stack[-1]) ]
    signature = cast_to_string(@stack.pop)
    return invalid unless Bitcoin::Script.check_signature_encoding?(signature, opts)
    return (@stack << 0) if signature == ""
    sig, hash_type = parse_sig(signature)
    subscript = sighash_subscript(drop_sigs, opts)
    if check_callback == nil 
      @stack << 1
    else 
      @stack <<
        ((check_callback.call(pubkey, sig, hash_type, subscript) == true) ? 1 : 0)
    end
  end
def op_checksig ( check_callback , opts = { } ) return invalid if @stack . size < 2 pubkey = cast_to_string ( @stack . pop ) return ( @stack << 0 ) unless Bitcoin :: Script . check_pubkey_encoding? ( pubkey , opts ) drop_sigs = [ cast_to_string ( @stack [ - 1 ] ) ] signature = cast_to_string ( @stack . pop ) return invalid unless Bitcoin :: Script . check_signature_encoding? ( signature , opts ) return ( @stack << 0 ) if signature == "" sig , hash_type = parse_sig ( signature ) subscript = sighash_subscript ( drop_sigs , opts ) if check_callback == nil @stack << 1 else @stack << ( ( check_callback . call ( pubkey , sig , hash_type , subscript ) == true ) ? 1 : 0 ) end end
do a CHECKSIG operation on the current stack,
asking +check_callback+ to do the actual signature verification.
do a CHECKSIG operation on the current stack asking + check_callback + to do the actual signature verification .
# for tests # real signature check callback
check_callback
<not_specific>
opts
<not_specific>