*/
private final ProbabilisticScorer prob_scorer;
private final Logger logger;
- private final KeysManager keys_manager;
+ private final EntropySource entropy_source;
+ private final NodeSigner node_signer;
/**
* Exposes the `ProbabilisticScorer` wrapped inside a lock. Don't forget to `close` this lock when you're done with
* @param router_wrapper If provided, routes will be fetched by calling the given router rather than an LDK `DefaultRouter`.
*/
public ChannelManagerConstructor(byte[] channel_manager_serialized, byte[][] channel_monitors_serialized, UserConfig config,
- KeysManager keys_manager, FeeEstimator fee_estimator, ChainMonitor chain_monitor,
+ EntropySource entropy_source, NodeSigner node_signer, SignerProvider signer_provider,
+ FeeEstimator fee_estimator, ChainMonitor chain_monitor,
@Nullable Filter filter, byte[] net_graph_serialized,
ProbabilisticScoringParameters scoring_params, byte[] probabilistic_scorer_bytes,
@Nullable RouterWrapper router_wrapper,
BroadcasterInterface tx_broadcaster, Logger logger) throws InvalidSerializedDataException {
- this.keys_manager = keys_manager;
- EntropySource entropy_source = keys_manager.as_EntropySource();
+ this.entropy_source = entropy_source;
+ this.node_signer = node_signer;
Result_NetworkGraphDecodeErrorZ graph_res = NetworkGraph.read(net_graph_serialized, logger);
if (!graph_res.is_ok()) {
this.channel_monitors = new TwoTuple_BlockHashChannelMonitorZ[monitors.length];
HashSet<OutPoint> monitor_funding_set = new HashSet();
for (int i = 0; i < monitors.length; i++) {
- Result_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ res = UtilMethods.C2Tuple_BlockHashChannelMonitorZ_read(channel_monitors_serialized[i], entropy_source, keys_manager.as_SignerProvider());
+ Result_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ res = UtilMethods.C2Tuple_BlockHashChannelMonitorZ_read(channel_monitors_serialized[i], entropy_source, signer_provider);
if (res instanceof Result_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ.Result_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ_Err) {
throw new InvalidSerializedDataException("Serialized ChannelMonitor was corrupt");
}
throw new InvalidSerializedDataException("Set of ChannelMonitors contained duplicates (ie the same funding_txo was set on multiple monitors)");
}
Result_C2Tuple_BlockHashChannelManagerZDecodeErrorZ res =
- UtilMethods.C2Tuple_BlockHashChannelManagerZ_read(channel_manager_serialized, keys_manager.as_EntropySource(),
- keys_manager.as_NodeSigner(), keys_manager.as_SignerProvider(), fee_estimator, chain_monitor.as_Watch(),
+ UtilMethods.C2Tuple_BlockHashChannelManagerZ_read(channel_manager_serialized, entropy_source,
+ node_signer, signer_provider, fee_estimator, chain_monitor.as_Watch(),
tx_broadcaster, router, logger, config, monitors);
if (!res.is_ok()) {
throw new InvalidSerializedDataException("Serialized ChannelManager was corrupt");
* @param router_wrapper If provided, routes will be fetched by calling the given router rather than an LDK `DefaultRouter`.
*/
public ChannelManagerConstructor(Network network, UserConfig config, byte[] current_blockchain_tip_hash, int current_blockchain_tip_height,
- KeysManager keys_manager, FeeEstimator fee_estimator, ChainMonitor chain_monitor,
+ EntropySource entropy_source, NodeSigner node_signer, SignerProvider signer_provider,
+ FeeEstimator fee_estimator, ChainMonitor chain_monitor,
NetworkGraph net_graph, ProbabilisticScoringParameters scoring_params,
@Nullable RouterWrapper router_wrapper,
BroadcasterInterface tx_broadcaster, Logger logger) {
- this.keys_manager = keys_manager;
- EntropySource entropy_source = keys_manager.as_EntropySource();
-
+ this.entropy_source = entropy_source;
+ this.node_signer = node_signer;
this.net_graph = net_graph;
assert(scoring_params != null);
this.prob_scorer = ProbabilisticScorer.of(scoring_params, net_graph, logger);
BestBlock block = BestBlock.of(current_blockchain_tip_hash, current_blockchain_tip_height);
ChainParameters params = ChainParameters.of(network, block);
channel_manager = ChannelManager.of(fee_estimator, chain_monitor.as_Watch(), tx_broadcaster, router, logger,
- keys_manager.as_EntropySource(), keys_manager.as_NodeSigner(), keys_manager.as_SignerProvider(), config, params);
+ entropy_source, node_signer, signer_provider, config, params);
this.logger = logger;
}
P2PGossipSync graph_msg_handler = P2PGossipSync.of(net_graph, Option_UtxoLookupZ.none(), logger);
this.peer_manager = PeerManager.of(channel_manager.as_ChannelMessageHandler(),
ignoring_handler.as_RoutingMessageHandler(), ignoring_handler.as_OnionMessageHandler(),
- (int)(System.currentTimeMillis() / 1000), this.keys_manager.as_EntropySource().get_secure_random_bytes(),
- logger, ignoring_handler.as_CustomMessageHandler(), keys_manager.as_NodeSigner());
+ (int)(System.currentTimeMillis() / 1000), this.entropy_source.get_secure_random_bytes(),
+ logger, ignoring_handler.as_CustomMessageHandler(), this.node_signer);
try {
this.nio_peer_handler = new NioPeerHandler(peer_manager);
if (use_chan_manager_constructor) {
this.constructor = new ChannelManagerConstructor(Network.LDKNetwork_Bitcoin, get_config(), new byte[32], 0,
- this.explicit_keys_manager, this.fee_estimator, this.chain_monitor, this.net_graph,
+ this.explicit_keys_manager.as_EntropySource(), this.explicit_keys_manager.as_NodeSigner(), this.explicit_keys_manager.as_SignerProvider(),
+ this.fee_estimator, this.chain_monitor, this.net_graph,
ProbabilisticScoringParameters.with_default(), (ChannelManagerConstructor.RouterWrapper)
(payer_node_id, route_params, first_hops, inflight_htlcs, payment_hash, payment_id, default_router) -> {
assert payment_hash != null && payment_id != null;
filter_nullable = ((Option_FilterZ.Some) this.filter).some;
}
this.constructor = new ChannelManagerConstructor(serialized, monitors, get_config(),
- this.explicit_keys_manager, this.fee_estimator, this.chain_monitor, filter_nullable,
+ this.explicit_keys_manager.as_EntropySource(), this.explicit_keys_manager.as_NodeSigner(), this.explicit_keys_manager.as_SignerProvider(),
+ this.fee_estimator, this.chain_monitor, filter_nullable,
serialized_graph, ProbabilisticScoringParameters.with_default(), serialized_scorer, null,
this.tx_broadcaster, this.logger);
try {
monitors_dupd[0] = monitors[0];
monitors_dupd[1] = monitors[0];
ChannelManagerConstructor constr = new ChannelManagerConstructor(serialized, monitors_dupd, get_config(),
- this.explicit_keys_manager, this.fee_estimator, this.chain_monitor, filter_nullable,
+ this.explicit_keys_manager.as_EntropySource(), this.explicit_keys_manager.as_NodeSigner(), this.explicit_keys_manager.as_SignerProvider(),
+ this.fee_estimator, this.chain_monitor, filter_nullable,
serialized_graph, ProbabilisticScoringParameters.with_default(), serialized_scorer, null,
this.tx_broadcaster, this.logger);
assert false;