lib/bitcoin/script.rb in bitcoin-ruby-0.0.7 vs lib/bitcoin/script.rb in bitcoin-ruby-0.0.8
- old
+ new
@@ -661,11 +661,11 @@
get_multisig_pubkeys.map{|pub|
begin
Bitcoin::Key.new(nil, pub.unpack("H*")[0]).addr
rescue OpenSSL::PKey::ECError, OpenSSL::PKey::EC::Point::Error
end
- }.compact
+ }
end
def get_p2sh_address
Bitcoin.hash160_to_p2sh_address(get_hash160)
end
@@ -823,9 +823,14 @@
end
def get_signatures_required
return false unless is_multisig?
@chunks[0] - 80
+ end
+
+ def get_keys_provided
+ return false unless is_multisig?
+ @chunks[-2] - 80
end
# This matches CScript::GetSigOpCount(bool fAccurate)
# Note: this does not cover P2SH script which is to be unserialized
# and checked explicitly when validating blocks.