package org.ldk.batteries;
-import org.jetbrains.annotations.Nullable;
-import org.ldk.enums.LDKNetwork;
+import javax.annotation.Nullable;
+import org.ldk.enums.Network;
import org.ldk.structs.*;
import org.ldk.util.TwoTuple;
this.peer_manager = PeerManager.of(channel_manager.as_ChannelMessageHandler(), (IgnoringMessageHandler.of()).as_RoutingMessageHandler(), keys_interface.get_node_secret(), random_data, logger);
}
NioPeerHandler nio_peer_handler = null;
- try { nio_peer_handler = new NioPeerHandler(this.peer_manager); } catch (IOException e) { assert false; }
+ try {
+ nio_peer_handler = new NioPeerHandler(this.peer_manager);
+ } catch (IOException e) {
+ throw new IllegalStateException("We should never fail to construct nio objects unless we're on a platform that cannot run LDK.");
+ }
this.nio_peer_handler = nio_peer_handler;
if (filter != null) {
for (ChannelMonitor monitor : monitors) {
/**
* Constructs a channel manager from the given interface implementations
*/
- public ChannelManagerConstructor(LDKNetwork network, UserConfig config, byte[] current_blockchain_tip_hash, int current_blockchain_tip_height,
+ public ChannelManagerConstructor(Network network, UserConfig config, byte[] current_blockchain_tip_hash, int current_blockchain_tip_height,
KeysInterface keys_interface, FeeEstimator fee_estimator, ChainMonitor chain_monitor,
@Nullable NetGraphMsgHandler router,
- BroadcasterInterface tx_broadcaster, Logger logger) throws InvalidSerializedDataException {
+ BroadcasterInterface tx_broadcaster, Logger logger) {
channel_monitors = new TwoTuple[0];
channel_manager_latest_block_hash = null;
this.chain_monitor = chain_monitor;
this.peer_manager = PeerManager.of(channel_manager.as_ChannelMessageHandler(), (IgnoringMessageHandler.of()).as_RoutingMessageHandler(), keys_interface.get_node_secret(), random_data, logger);
}
NioPeerHandler nio_peer_handler = null;
- try { nio_peer_handler = new NioPeerHandler(this.peer_manager); } catch (IOException e) { assert false; }
+ try {
+ nio_peer_handler = new NioPeerHandler(this.peer_manager);
+ } catch (IOException e) {
+ throw new IllegalStateException("We should never fail to construct nio objects unless we're on a platform that cannot run LDK.");
+ }
this.nio_peer_handler = nio_peer_handler;
}