Sha256: 1c065a550b85e6827bdaebaab2484b5169a31545b4e3dce35c17f4ca1bed0bef

Contents?: true

Size: 444 Bytes

Versions: 3

Compression:

Stored size: 444 Bytes

Contents

# frozen_string_literal: true

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

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

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
lightning-onion-0.2.10 lib/lightning/onion/failure_messages/amount_below_minimum.rb
lightning-onion-0.2.9 lib/lightning/onion/failure_messages/amount_below_minimum.rb
lightning-onion-0.2.8 lib/lightning/onion/failure_messages/amount_below_minimum.rb