File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -20,7 +20,7 @@ use bitcoin::key::Secp256k1;
2020use bitcoin:: secp256k1:: PublicKey ;
2121use bitcoin:: { BlockHash , Network } ;
2222use bitcoin_payment_instructions:: onion_message_resolver:: LDKOnionMessageDNSSECHrnResolver ;
23- use lightning:: chain:: { chainmonitor , BestBlock } ;
23+ use lightning:: chain:: BestBlock ;
2424use lightning:: ln:: channelmanager:: { self , ChainParameters , ChannelManagerReadArgs } ;
2525use lightning:: ln:: msgs:: { RoutingMessageHandler , SocketAddress } ;
2626use lightning:: ln:: peer_handler:: { IgnoringMessageHandler , MessageHandler } ;
@@ -1313,8 +1313,8 @@ fn build_with_store_internal(
13131313 Arc :: clone ( & fee_estimator) ,
13141314 ) ) ;
13151315
1316- // Initialize the ChainMonitor
1317- let chain_monitor: Arc < ChainMonitor > = Arc :: new ( chainmonitor :: ChainMonitor :: new (
1316+ // Initialize the ChainMonitor wrapped with DeferredChainMonitor for safe persistence ordering
1317+ let chain_monitor: Arc < ChainMonitor > = Arc :: new ( ChainMonitor :: new (
13181318 Some ( Arc :: clone ( & chain_source) ) ,
13191319 Arc :: clone ( & tx_broadcaster) ,
13201320 Arc :: clone ( & logger) ,
Original file line number Diff line number Diff line change @@ -13,7 +13,7 @@ use std::sync::{Arc, Mutex};
1313use bitcoin:: secp256k1:: PublicKey ;
1414use bitcoin:: { OutPoint , ScriptBuf } ;
1515use bitcoin_payment_instructions:: onion_message_resolver:: LDKOnionMessageDNSSECHrnResolver ;
16- use lightning:: chain:: chainmonitor ;
16+ use lightning:: chain:: deferred :: DeferredChainMonitor as LdkDeferredChainMonitor ;
1717use lightning:: impl_writeable_tlv_based;
1818use lightning:: ln:: channel_state:: ChannelDetails as LdkChannelDetails ;
1919use lightning:: ln:: msgs:: { RoutingMessageHandler , SocketAddress } ;
@@ -206,7 +206,7 @@ pub type Persister = MonitorUpdatingPersister<
206206 Arc < OnchainFeeEstimator > ,
207207> ;
208208
209- pub ( crate ) type ChainMonitor = chainmonitor :: ChainMonitor <
209+ pub ( crate ) type ChainMonitor = LdkDeferredChainMonitor <
210210 InMemorySigner ,
211211 Arc < ChainSource > ,
212212 Arc < Broadcaster > ,
You can’t perform that action at this time.
0 commit comments