lib/tapyrus/tx_out.rb in tapyrus-0.1.0 vs lib/tapyrus/tx_out.rb in tapyrus-0.2.0

- old
+ new

@@ -5,10 +5,11 @@ # transaction output class TxOut include OpenAssets::MarkerOutput + include Tapyrus::Color::ColoredOutput attr_accessor :value attr_accessor :script_pubkey def initialize(value: 0, script_pubkey: nil) @@ -60,10 +61,10 @@ private def dust_threshold return 0 if script_pubkey.unspendable? n_size = size - n_size += script_pubkey.witness_program? ? (32 + 4 + 1 + (107 / Tapyrus::WITNESS_SCALE_FACTOR) + 4) : (32 + 4 + 1 + 107 + 4) + 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