Skip to content

Commit 52b7004

Browse files
rustyrussellsangbida
authored andcommitted
connectd: rescue constant message size feature by exploiting OPT_ONION_MESSAGES (LND)
I 🧡 Laolu! Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
1 parent 7569c6e commit 52b7004

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

connectd/multiplex.c

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -481,9 +481,13 @@ static bool have_empty_encrypted_queue(const struct peer *peer)
481481
return membuf_num_elems(&peer->encrypted_peer_out) == 0;
482482
}
483483

484+
/* Funny story: we discovered an LND bug, where they hung up if we sent
485+
* "no reply" ping messages. This was fixed in (the upcoming) v21, which
486+
* Laolu pointed out also supports onion messages. Hence we use that
487+
* to detect if we should pad packets. */
484488
static bool use_uniform_writes(const struct peer *peer)
485489
{
486-
return peer->daemon->dev_uniform_padding;
490+
return feature_offered(peer->their_features, OPT_ONION_MESSAGES);
487491
}
488492

489493
/* (Continue) writing the encrypted_peer_out array */

0 commit comments

Comments
 (0)