Module: Lightning::Onion::FailureMessages::AmountBelowMinimum

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

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

Instance Method Details

#to_payloadObject



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

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