Class: Bitcoin::Message::NotFound
- Defined in:
- lib/bitcoin/message/not_found.rb
Overview
notfound message bitcoin.org/en/developer-reference#notfound
Constant Summary collapse
- COMMAND =
'notfound'
Constants included from Util
Instance Attribute Summary collapse
-
#inventory ⇒ Object
Returns the value of attribute inventory.
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(identifier, hash) ⇒ NotFound
constructor
A new instance of NotFound.
- #to_payload ⇒ Object
Methods inherited from Base
Methods included from Util
#byte_to_bit, #calc_checksum, #decode_base58_address, #double_sha256, #encode_base58_address, #hash160, #hmac_sha256, #pack_boolean, #pack_var_int, #pack_var_string, #sha256, #unpack_boolean, #unpack_var_int, #unpack_var_int_from_io, #unpack_var_string
Constructor Details
Instance Attribute Details
#inventory ⇒ Object
Returns the value of attribute inventory.
8 9 10 |
# File 'lib/bitcoin/message/not_found.rb', line 8 def inventory @inventory end |
Class Method Details
.parse_from_payload(payload) ⇒ Object
16 17 18 19 20 |
# File 'lib/bitcoin/message/not_found.rb', line 16 def self.parse_from_payload(payload) size, inventory_payload = Bitcoin.unpack_var_int(payload) inventory = Inventory.parse_from_payload(inventory_payload) new(inventory.identifier, inventory.hash) end |
Instance Method Details
#to_payload ⇒ Object
22 23 24 |
# File 'lib/bitcoin/message/not_found.rb', line 22 def to_payload Bitcoin.pack_var_int(1) << inventory.to_payload end |