Skip to content

Commit 8499b32

Browse files
committed
fixup! multi: Support jumbo size om packets
1 parent 303eae4 commit 8499b32

File tree

1 file changed

+4
-11
lines changed

1 file changed

+4
-11
lines changed

sphinx.go

Lines changed: 4 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -235,18 +235,11 @@ func NewOnionPacket(paymentPath *PaymentPath, sessionKey *btcec.PrivateKey,
235235

236236
totalPayloadSize := paymentPath.TotalPayloadSize()
237237

238-
var routingInfoLen int
238+
routingInfoLen := StandardRoutingInfoSize
239239
maxRoutingInfoErr := ErrStandardRoutingInfoSizeExceeded
240-
if cfg.isOnionMessage {
241-
switch {
242-
case totalPayloadSize <= StandardRoutingInfoSize:
243-
routingInfoLen = StandardRoutingInfoSize
244-
default:
245-
routingInfoLen = JumboRoutingInfoSize
246-
maxRoutingInfoErr = ErrJumboRoutingInfoSizeExceeded
247-
}
248-
} else {
249-
routingInfoLen = StandardRoutingInfoSize
240+
if cfg.isOnionMessage && totalPayloadSize > StandardRoutingInfoSize {
241+
routingInfoLen = JumboRoutingInfoSize
242+
maxRoutingInfoErr = ErrJumboRoutingInfoSizeExceeded
250243
}
251244

252245
// Check whether total payload size doesn't exceed the hard maximum.

0 commit comments

Comments
 (0)