Module: Lightning::Onion::FailureMessages::InvalidOnionKey

Defined in:
lib/lightning/onion/failure_messages/invalid_onion_key.rb

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.load(payload) ⇒ Object



11
12
13
14
# File 'lib/lightning/onion/failure_messages/invalid_onion_key.rb', line 11

def self.load(payload)
  len, rest = payload.unpack('nH*')
  new(rest[0..len * 2])
end

Instance Method Details

#to_payloadObject



7
8
9
# File 'lib/lightning/onion/failure_messages/invalid_onion_key.rb', line 7

def to_payload
  [TYPES[:invalid_onion_key], sha256_of_onion.htb.bytesize].pack('n2') + sha256_of_onion.htb
end