Sha256: c425493b818443d8becaea7d38874f924ce03a7bbbebae76e2a8ed55d95672e0

Contents?: true

Size: 411 Bytes

Versions: 3

Compression:

Stored size: 411 Bytes

Contents

# frozen_string_literal: true

module Lightning
  module Onion
    module FailureMessages
      module InvalidOnionVersion
        def to_payload
          [TYPES[:invalid_onion_version], sha256_of_onion.htb.bytesize].pack('n2') + sha256_of_onion.htb
        end

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