Module: Lightning::Onion::FailureMessages::IncorrectCltvExpiry

Defined in:
lib/lightning/onion/failure_messages/incorrect_cltv_expiry.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/incorrect_cltv_expiry.rb', line 11

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

Instance Method Details

#to_payloadObject



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

def to_payload
  [TYPES[:incorrect_cltv_expiry], cltv_expiry, channel_update.htb.bytesize].pack('nq>n') + channel_update.htb
end