class Tapyrus::Message::PrefilledTx
A PrefilledTransaction structure is used in HeaderAndShortIDs
to provide a list of a few transactions explicitly. github.com/bitcoin/bips/blob/master/bip-0152.mediawiki
Attributes
index[RW]
tx[RW]
Public Class Methods
new(index, tx)
click to toggle source
# File lib/tapyrus/message/prefilled_tx.rb, line 9 def initialize(index, tx) @index = index @tx = tx end
parse_from_io(io)
click to toggle source
# File lib/tapyrus/message/prefilled_tx.rb, line 14 def self.parse_from_io(io) index = Tapyrus.unpack_var_int_from_io(io) tx = Tapyrus::Tx.parse_from_payload(io) self.new(index, tx) end
Public Instance Methods
to_payload()
click to toggle source
# File lib/tapyrus/message/prefilled_tx.rb, line 20 def to_payload Tapyrus.pack_var_int(index) << tx.to_payload end