Sha256: 57a8edaceefe0681f7a7cea963d409663ca4424a15db443b8b54ba22969eebbf

Contents?: true

Size: 403 Bytes

Versions: 3

Compression:

Stored size: 403 Bytes

Contents

# frozen_string_literal: true

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