Skip to content

Commit d256a2b

Browse files
committed
Fix bench lifetimes.
Benchmarks were failing because node config and channel monitor configs were tied to the same lifetime. Introducing a separate lifetime allows to avoid out-of-order deallocation errors.
1 parent 5e6bc76 commit d256a2b

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

lightning/src/ln/channelmanager.rs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -10534,13 +10534,13 @@ pub mod bench {
1053410534
&'a test_utils::TestFeeEstimator, &'a test_utils::TestRouter<'a>,
1053510535
&'a test_utils::TestLogger>;
1053610536

10537-
struct ANodeHolder<'a, P: Persist<InMemorySigner>> {
10538-
node: &'a Manager<'a, P>,
10537+
struct ANodeHolder<'node_cfg, 'chan_mon_cfg: 'node_cfg, P: Persist<InMemorySigner>> {
10538+
node: &'node_cfg Manager<'chan_mon_cfg, P>,
1053910539
}
10540-
impl<'a, P: Persist<InMemorySigner>> NodeHolder for ANodeHolder<'a, P> {
10541-
type CM = Manager<'a, P>;
10540+
impl<'node_cfg, 'chan_mon_cfg: 'node_cfg, P: Persist<InMemorySigner>> NodeHolder for ANodeHolder<'node_cfg, 'chan_mon_cfg, P> {
10541+
type CM = Manager<'chan_mon_cfg, P>;
1054210542
#[inline]
10543-
fn node(&self) -> &Manager<'a, P> { self.node }
10543+
fn node(&self) -> &Manager<'chan_mon_cfg, P> { self.node }
1054410544
#[inline]
1054510545
fn chain_monitor(&self) -> Option<&test_utils::TestChainMonitor> { None }
1054610546
}

0 commit comments

Comments
 (0)