module Lightning::Onion::FailureMessages

Constants

BADONION

unparsable onion encrypted by sending peer

FailureMessage
NODE

node failure (otherwise channel)

PERM

permanent failure (otherwise transient)

TYPES
UPDATE

new channel update enclosed

Public Class Methods

load(payload) click to toggle source
# File lib/lightning/onion/failure_messages.rb, line 116
def self.load(payload)
  type, rest = payload.unpack('na*')
  message_class = FailureMessage.variants.find do |t|
    TYPES[t.name.split('::').last.snake.to_sym] == type
  end
  message_class.load(rest)
end