lib/tapyrus/tx_out.rb in tapyrus-0.2.7 vs lib/tapyrus/tx_out.rb in tapyrus-0.2.8
- old
+ new
@@ -1,13 +1,11 @@
# Porting part of the code from bitcoin-ruby. see the license.
# https://github.com/lian/bitcoin-ruby/blob/master/COPYING
module Tapyrus
-
# transaction output
class TxOut
-
include OpenAssets::MarkerOutput
include Tapyrus::Color::ColoredOutput
attr_accessor :value
attr_accessor :script_pubkey
@@ -37,11 +35,11 @@
def value_to_btc
value / 100000000.0
end
def to_h
- {value: value_to_btc, script_pubkey: script_pubkey.to_h}
+ { value: value_to_btc, script_pubkey: script_pubkey.to_h }
end
def ==(other)
to_payload == other.to_payload
end
@@ -63,13 +61,10 @@
def dust_threshold
return 0 if script_pubkey.unspendable?
n_size = size
n_size += (32 + 4 + 1 + 107 + 4)
fee = n_size * Tapyrus.chain_params.dust_relay_fee / 1000
- if fee == 0 && n_size != 0
- fee = Tapyrus.chain_params.dust_relay_fee > 0 ? 1 : -1
- end
+ fee = Tapyrus.chain_params.dust_relay_fee > 0 ? 1 : -1 if fee == 0 && n_size != 0
fee
end
end
-
end