Sha256: 6ee56bad1c026651cba410f20fa9cab51d9b4a088b445e85697fe3b41af60e35

Contents?: true

Size: 437 Bytes

Versions: 3

Compression:

Stored size: 437 Bytes

Contents

# frozen_string_literal: true

module Lightning
  module Onion
    module FailureMessages
      module FeeInsufficient
        def to_payload
          [TYPES[:fee_insufficient], 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/fee_insufficient.rb
lightning-onion-0.2.9 lib/lightning/onion/failure_messages/fee_insufficient.rb
lightning-onion-0.2.8 lib/lightning/onion/failure_messages/fee_insufficient.rb