@@ -78,7 +78,8 @@ public static class InvalidSerializedDataException extends Exception {
7878 */
7979 private final ProbabilisticScorer prob_scorer ;
8080 private final Logger logger ;
81- private final KeysManager keys_manager ;
81+ private final EntropySource entropy_source ;
82+ private final NodeSigner node_signer ;
8283
8384 /**
8485 * Exposes the `ProbabilisticScorer` wrapped inside a lock. Don't forget to `close` this lock when you're done with
@@ -132,13 +133,14 @@ Result_RouteLightningErrorZ find_route(byte[] payer_node_id, RouteParameters rou
132133 * @param router_wrapper If provided, routes will be fetched by calling the given router rather than an LDK `DefaultRouter`.
133134 */
134135 public ChannelManagerConstructor (byte [] channel_manager_serialized , byte [][] channel_monitors_serialized , UserConfig config ,
135- KeysManager keys_manager , FeeEstimator fee_estimator , ChainMonitor chain_monitor ,
136+ EntropySource entropy_source , NodeSigner node_signer , SignerProvider signer_provider ,
137+ FeeEstimator fee_estimator , ChainMonitor chain_monitor ,
136138 @ Nullable Filter filter , byte [] net_graph_serialized ,
137139 ProbabilisticScoringParameters scoring_params , byte [] probabilistic_scorer_bytes ,
138140 @ Nullable RouterWrapper router_wrapper ,
139141 BroadcasterInterface tx_broadcaster , Logger logger ) throws InvalidSerializedDataException {
140- this .keys_manager = keys_manager ;
141- EntropySource entropy_source = keys_manager . as_EntropySource () ;
142+ this .entropy_source = entropy_source ;
143+ this . node_signer = node_signer ;
142144
143145 Result_NetworkGraphDecodeErrorZ graph_res = NetworkGraph .read (net_graph_serialized , logger );
144146 if (!graph_res .is_ok ()) {
@@ -173,7 +175,7 @@ public ChannelManagerConstructor(byte[] channel_manager_serialized, byte[][] cha
173175 this .channel_monitors = new TwoTuple_BlockHashChannelMonitorZ [monitors .length ];
174176 HashSet <OutPoint > monitor_funding_set = new HashSet ();
175177 for (int i = 0 ; i < monitors .length ; i ++) {
176- Result_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ res = UtilMethods .C2Tuple_BlockHashChannelMonitorZ_read (channel_monitors_serialized [i ], entropy_source , keys_manager . as_SignerProvider () );
178+ Result_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ res = UtilMethods .C2Tuple_BlockHashChannelMonitorZ_read (channel_monitors_serialized [i ], entropy_source , signer_provider );
177179 if (res instanceof Result_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ .Result_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ_Err ) {
178180 throw new InvalidSerializedDataException ("Serialized ChannelMonitor was corrupt" );
179181 }
@@ -184,8 +186,8 @@ public ChannelManagerConstructor(byte[] channel_manager_serialized, byte[][] cha
184186 throw new InvalidSerializedDataException ("Set of ChannelMonitors contained duplicates (ie the same funding_txo was set on multiple monitors)" );
185187 }
186188 Result_C2Tuple_BlockHashChannelManagerZDecodeErrorZ res =
187- UtilMethods .C2Tuple_BlockHashChannelManagerZ_read (channel_manager_serialized , keys_manager . as_EntropySource () ,
188- keys_manager . as_NodeSigner (), keys_manager . as_SignerProvider () , fee_estimator , chain_monitor .as_Watch (),
189+ UtilMethods .C2Tuple_BlockHashChannelManagerZ_read (channel_manager_serialized , entropy_source ,
190+ node_signer , signer_provider , fee_estimator , chain_monitor .as_Watch (),
189191 tx_broadcaster , router , logger , config , monitors );
190192 if (!res .is_ok ()) {
191193 throw new InvalidSerializedDataException ("Serialized ChannelManager was corrupt" );
@@ -207,13 +209,13 @@ public ChannelManagerConstructor(byte[] channel_manager_serialized, byte[][] cha
207209 * @param router_wrapper If provided, routes will be fetched by calling the given router rather than an LDK `DefaultRouter`.
208210 */
209211 public ChannelManagerConstructor (Network network , UserConfig config , byte [] current_blockchain_tip_hash , int current_blockchain_tip_height ,
210- KeysManager keys_manager , FeeEstimator fee_estimator , ChainMonitor chain_monitor ,
212+ EntropySource entropy_source , NodeSigner node_signer , SignerProvider signer_provider ,
213+ FeeEstimator fee_estimator , ChainMonitor chain_monitor ,
211214 NetworkGraph net_graph , ProbabilisticScoringParameters scoring_params ,
212215 @ Nullable RouterWrapper router_wrapper ,
213216 BroadcasterInterface tx_broadcaster , Logger logger ) {
214- this .keys_manager = keys_manager ;
215- EntropySource entropy_source = keys_manager .as_EntropySource ();
216-
217+ this .entropy_source = entropy_source ;
218+ this .node_signer = node_signer ;
217219 this .net_graph = net_graph ;
218220 assert (scoring_params != null );
219221 this .prob_scorer = ProbabilisticScorer .of (scoring_params , net_graph , logger );
@@ -239,7 +241,7 @@ public ChannelManagerConstructor(Network network, UserConfig config, byte[] curr
239241 BestBlock block = BestBlock .of (current_blockchain_tip_hash , current_blockchain_tip_height );
240242 ChainParameters params = ChainParameters .of (network , block );
241243 channel_manager = ChannelManager .of (fee_estimator , chain_monitor .as_Watch (), tx_broadcaster , router , logger ,
242- keys_manager . as_EntropySource (), keys_manager . as_NodeSigner (), keys_manager . as_SignerProvider () , config , params );
244+ entropy_source , node_signer , signer_provider , config , params );
243245 this .logger = logger ;
244246 }
245247
@@ -279,8 +281,8 @@ public void chain_sync_completed(EventHandler event_handler, boolean use_p2p_gra
279281 P2PGossipSync graph_msg_handler = P2PGossipSync .of (net_graph , Option_UtxoLookupZ .none (), logger );
280282 this .peer_manager = PeerManager .of (channel_manager .as_ChannelMessageHandler (),
281283 ignoring_handler .as_RoutingMessageHandler (), ignoring_handler .as_OnionMessageHandler (),
282- (int )(System .currentTimeMillis () / 1000 ), this .keys_manager . as_EntropySource () .get_secure_random_bytes (),
283- logger , ignoring_handler .as_CustomMessageHandler (), keys_manager . as_NodeSigner () );
284+ (int )(System .currentTimeMillis () / 1000 ), this .entropy_source .get_secure_random_bytes (),
285+ logger , ignoring_handler .as_CustomMessageHandler (), this . node_signer );
284286
285287 try {
286288 this .nio_peer_handler = new NioPeerHandler (peer_manager );
0 commit comments