class Bitcoin::Message::Tx
tx message bitcoin.org/en/developer-reference#tx
Constants
- COMMAND
Attributes
tx[RW]
use_segwit[RW]
Public Class Methods
new(tx, use_segwit = false)
click to toggle source
# File lib/bitcoin/message/tx.rb, line 13 def initialize(tx, use_segwit = false) @tx = tx @use_segwit = use_segwit end
parse_from_payload(payload)
click to toggle source
# File lib/bitcoin/message/tx.rb, line 18 def self.parse_from_payload(payload) tx = Bitcoin::Tx.parse_from_payload(payload, strict: true) new(tx, tx.witness?) end
Public Instance Methods
to_payload()
click to toggle source
# File lib/bitcoin/message/tx.rb, line 23 def to_payload use_segwit ? tx.to_payload : tx.serialize_old_format end