IncomingPaymentPacket

Helpers to handle incoming payment packets.

Companion:
class
Source:
PaymentPacket.scala
trait Sum
trait Mirror
class Object
trait Matchable
class Any

Type members

Classlikes

case class ChannelRelayPacket(add: UpdateAddHtlc, payload: ChannelRelayData, nextPacket: OnionRoutingPacket, nextBlindingKeyOpt: Option[PublicKey]) extends RelayPacket

We must relay the payment to a direct peer.

We must relay the payment to a direct peer.

Source:
PaymentPacket.scala
case class DecodedOnionPacket[T <: PacketType](payload: T, next: OnionRoutingPacket)

We are the final recipient.

We are the final recipient.

Source:
PaymentPacket.scala
case class NodeRelayPacket(add: UpdateAddHtlc, outerPayload: FinalTlvPayload, innerPayload: NodeRelayPayload, nextPacket: OnionRoutingPacket) extends RelayPacket

We must relay the payment to a remote node.

We must relay the payment to a remote node.

Source:
PaymentPacket.scala
sealed trait RelayPacket extends IncomingPaymentPacket

We are an intermediate node.

We are an intermediate node.

Source:
PaymentPacket.scala

Inherited types

type MirroredElemLabels <: Tuple

The names of the product elements

The names of the product elements

Inherited from:
Mirror
Source:
Mirror.scala
type MirroredLabel <: String

The name of the type

The name of the type

Inherited from:
Mirror
Source:
Mirror.scala

Value members

Concrete methods

Decrypt the onion packet of a received htlc. If we are the final recipient, we validate that the HTLC fields match the onion fields (this prevents intermediate nodes from sending an invalid amount or expiry).

Decrypt the onion packet of a received htlc. If we are the final recipient, we validate that the HTLC fields match the onion fields (this prevents intermediate nodes from sending an invalid amount or expiry).

NB: we can't fully validate RelayPackets because it requires knowing the channel/route we'll be using, which we don't know yet. Such validation is the responsibility of downstream components.

Value parameters:
add

incoming htlc

privateKey

this node's private key

Returns:

whether the payment is to be relayed or if our node is the final recipient (or an error).

Source:
PaymentPacket.scala