Sha256: a39090ddf42412664fdddfbdb4b91e55db2f4921194c614456511d9b61da098d

Contents?: true

Size: 412 Bytes

Versions: 7

Compression:

Stored size: 412 Bytes

Contents

# frozen_string_literal: true

module Lightning
  module Onion
    module FailureMessages
      module TemporaryChannelFailure
        def to_payload
          [type_code, channel_update.bytesize].pack('nn') + channel_update.htb
        end

        def self.load(payload)
          type_code, len, rest = payload.unpack('nnH*')
          new(type_code, rest[0..len * 2])
        end
      end
    end
  end
end

Version data entries

7 entries across 7 versions & 1 rubygems

Version Path
lightning-onion-0.2.6 lib/lightning/onion/failure_messages/temporary_channel_failure.rb
lightning-onion-0.2.5 lib/lightning/onion/failure_messages/temporary_channel_failure.rb
lightning-onion-0.2.4 lib/lightning/onion/failure_messages/temporary_channel_failure.rb
lightning-onion-0.2.3 lib/lightning/onion/failure_messages/temporary_channel_failure.rb
lightning-onion-0.2.2 lib/lightning/onion/failure_messages/temporary_channel_failure.rb
lightning-onion-0.2.1 lib/lightning/onion/failure_messages/temporary_channel_failure.rb
lightning-onion-0.2.0 lib/lightning/onion/failure_messages/temporary_channel_failure.rb