Class: Tapyrus::Message::GetHeaders

Inherits:
Base
  • Object
show all
Extended by:
HeadersParser
Includes:
HeadersParser
Defined in:
lib/tapyrus/message/get_headers.rb

Overview

Constant Summary collapse

COMMAND =
"getheaders"

Constants included from Util

Util::DIGEST_NAME_SHA256

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods included from HeadersParser

parse_from_payload, to_payload

Methods inherited from Base

#to_payload, #to_pkt

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, #padding_zero, #sha256, #unpack_boolean, #unpack_var_int, #unpack_var_int_from_io, #unpack_var_string, #valid_address?

Methods included from HexConverter

#to_hex

Constructor Details

#initialize(version, hashes, stop_hash = DEFAULT_STOP_HASH) ⇒ GetHeaders

Returns a new instance of GetHeaders.



19
20
21
22
23
# File 'lib/tapyrus/message/get_headers.rb', line 19

def initialize(version, hashes, stop_hash = DEFAULT_STOP_HASH)
  @version = version
  @hashes = hashes
  @stop_hash = stop_hash
end

Instance Attribute Details

#hashesObject

block header hashes



15
16
17
# File 'lib/tapyrus/message/get_headers.rb', line 15

def hashes
  @hashes
end

#stop_hashObject

Returns the value of attribute stop_hash.



17
18
19
# File 'lib/tapyrus/message/get_headers.rb', line 17

def stop_hash
  @stop_hash
end

#versionObject

protocol version



12
13
14
# File 'lib/tapyrus/message/get_headers.rb', line 12

def version
  @version
end