lib/bitcoin/protocol/txout.rb in bitcoin-ruby-0.0.6 vs lib/bitcoin/protocol/txout.rb in bitcoin-ruby-0.0.7
- old
+ new
@@ -64,11 +64,11 @@
h["address"] = parsed_script.get_address if parsed_script.is_hash160? && options[:with_address]
h
end
def self.from_hash(output)
- amount = output['value'].gsub('.','').to_i
- script = Script.binary_from_string(output['scriptPubKey'])
+ amount = output['value'] ? output['value'].gsub('.','').to_i : output['amount']
+ script = Script.binary_from_string(output['scriptPubKey'] || output['script'])
new(amount, script)
end
# set pk_script and pk_script_length
def pk_script=(pk_script)