Skip to content

Commit 4220388

Browse files
committed
Disable chan announce re-broadcast when _test_utils feat is on
In our upgrade/downgrade tests we want to be able to use the functional test utils as-is externally as a part of CI in later LDK versions. This implies that code that is `cfg(test)` really needs to always be `cfg(any(test, feature = "_test_utils"))`. Sadly, trying to open multiple channels back-to-back on a node with `_test_utils` currently fails as we re-broadcast channel announcement messages, something the functional test utils does not expect. Here we update the `cfg`-flagging of that rebroadcast logic to fix back-to-back channel opens in `_test_utils`. This narrowly backports one hunk of the much larger upstream commit e41e756.
1 parent 5ba2b0a commit 4220388

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

lightning/src/ln/channelmanager.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11365,7 +11365,7 @@ where
1136511365
// Most of our tests were written when we only broadcasted
1136611366
// `channel_announcement`s once and then never re-broadcasted
1136711367
// them again, so disable the re-broadcasting entirely in tests
11368-
#[cfg(test)]
11368+
#[cfg(any(test, feature = "_test_utils"))]
1136911369
{
1137011370
should_announce = announcement_sigs.is_some();
1137111371
}

0 commit comments

Comments
 (0)