Sha256: 54f1470a33d5012d9976d0769e1773d8f6bcab84fe4f0ccfaefd516db3830d62
Contents?: true
Size: 547 Bytes
Versions: 38
Compression:
Stored size: 547 Bytes
Contents
module Bitcoin module Message # Common message parser which only handle multiple inventory as payload. module InventoriesParser def parse_from_payload(payload) size, payload = Bitcoin.unpack_var_int(payload) buf = StringIO.new(payload) i = new size.times do i.inventories << Inventory.parse_from_payload(buf.read(36)) end i end def to_payload Bitcoin.pack_var_int(inventories.length) << inventories.map(&:to_payload).join end end end end
Version data entries
38 entries across 38 versions & 1 rubygems