Sha256: 42fc24a9b2216b0c71dd984a1cfacdbcf261a65d43f64be809dfe8dab15dd055

Contents?: true

Size: 452 Bytes

Versions: 3

Compression:

Stored size: 452 Bytes

Contents

# frozen_string_literal: true

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

        def self.load(payload)
          cltv_expiry, len, rest = payload.unpack('q>nH*')
          new(cltv_expiry, 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/incorrect_cltv_expiry.rb
lightning-onion-0.2.9 lib/lightning/onion/failure_messages/incorrect_cltv_expiry.rb
lightning-onion-0.2.8 lib/lightning/onion/failure_messages/incorrect_cltv_expiry.rb