Skip to content

Commit 3604a21

Browse files
committed
Use the new load_existing_monitor over watch_channel
Now that we have `ChainMonitor::load_existing_monitor` we can use it during startup to avoid the excess persistence at startup.
1 parent 4d9ae57 commit 3604a21

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/main.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ use bitcoin::BlockHash;
1616
use bitcoin_bech32::WitnessProgram;
1717
use disk::{INBOUND_PAYMENTS_FNAME, OUTBOUND_PAYMENTS_FNAME};
1818
use lightning::chain::{chainmonitor, ChannelMonitorUpdateStatus};
19-
use lightning::chain::{BestBlock, Filter, Watch};
19+
use lightning::chain::{BestBlock, Filter};
2020
use lightning::events::bump_transaction::{BumpTransactionEventHandler, Wallet};
2121
use lightning::events::{Event, PaymentFailureReason, PaymentPurpose};
2222
use lightning::ln::channelmanager::{self, RecentPaymentDetails};
@@ -871,7 +871,7 @@ async fn start_ldk() {
871871
for (_, (channel_monitor, _, _, _), _) in chain_listener_channel_monitors {
872872
let channel_id = channel_monitor.channel_id();
873873
assert_eq!(
874-
chain_monitor.watch_channel(channel_id, channel_monitor),
874+
chain_monitor.load_existing_monitor(channel_id, channel_monitor),
875875
Ok(ChannelMonitorUpdateStatus::Completed)
876876
);
877877
}

0 commit comments

Comments
 (0)