Skip to content

Commit 680da4f

Browse files
committed
Correct test_dup_htlc_onchain_doesnt_fail_on_reload
`test_dup_htlc_onchain_doesnt_fail_on_reload` made reference to `ChainMonitor` persisting `ChannelMonitor`s on each new block, which hasn't been the case in some time. Instead, we update the comment and code to make explicit that it doesn't impact the test.
1 parent 61e5819 commit 680da4f

File tree

1 file changed

+5
-6
lines changed

1 file changed

+5
-6
lines changed

lightning/src/ln/payment_tests.rs

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
use crate::chain::channelmonitor::{
1515
ANTI_REORG_DELAY, HTLC_FAIL_BACK_BUFFER, LATENCY_GRACE_PERIOD_BLOCKS,
1616
};
17-
use crate::chain::{ChannelMonitorUpdateStatus, Confirm, Listen};
17+
use crate::chain::{Confirm, Listen};
1818
use crate::events::{
1919
ClosureReason, Event, HTLCHandlingFailureType, PathFailure, PaymentFailureReason,
2020
PaymentPurpose,
@@ -1310,16 +1310,15 @@ fn do_test_dup_htlc_onchain_doesnt_fail_on_reload(
13101310
connect_blocks(&nodes[0], ANTI_REORG_DELAY - 2);
13111311
}
13121312

1313-
// Now connect the HTLC claim transaction with the ChainMonitor-generated ChannelMonitor update
1314-
// returning InProgress. This should cause the claim event to never make its way to the
1315-
// ChannelManager.
1316-
chanmon_cfgs[0].persister.set_update_ret(ChannelMonitorUpdateStatus::InProgress);
1317-
1313+
// Now connect the HTLC claim transaction. Note that ChannelMonitors aren't re-persisted on
1314+
// each block connection (as the block being reconnected on startup should get us the same
1315+
// result).
13181316
if payment_timeout {
13191317
connect_blocks(&nodes[0], 1);
13201318
} else {
13211319
connect_block(&nodes[0], &claim_block);
13221320
}
1321+
check_added_monitors(&nodes[0], 0);
13231322

13241323
// Note that we skip persisting ChannelMonitors. We should still be generating the payment sent
13251324
// event without ChannelMonitor persistence. If we reset to a previous state on reload, the block

0 commit comments

Comments
 (0)