final KeysInterface keys_interface;
final ChannelManager chan_manager;
final EventsProvider chan_manager_events;
final KeysInterface keys_interface;
final ChannelManager chan_manager;
final EventsProvider chan_manager_events;
final PeerManager peer_manager;
final HashMap<String, ChannelMonitor> monitors; // Wow I forgot just how terrible Java is - we can't put a byte array here.
byte[] node_id;
final PeerManager peer_manager;
final HashMap<String, ChannelMonitor> monitors; // Wow I forgot just how terrible Java is - we can't put a byte array here.
byte[] node_id;
- logger = new Logger((String arg) -> System.out.println(seed + ": " + arg));
- fee_estimator = new FeeEstimator((confirmation_target -> 253));
- tx_broadcaster = new BroadcasterInterface(tx -> {
+ logger = Logger.new_impl((String arg) -> System.out.println(seed + ": " + arg));
+ fee_estimator = FeeEstimator.new_impl((confirmation_target -> 253));
+ tx_broadcaster = BroadcasterInterface.new_impl(tx -> {
public Result_NoneChannelMonitorUpdateErrZ watch_channel(OutPoint funding_txo, ChannelMonitor monitor) {
synchronized (monitors) {
assert monitors.put(Arrays.toString(funding_txo.get_txid()), monitor) == null;
public Result_NoneChannelMonitorUpdateErrZ watch_channel(OutPoint funding_txo, ChannelMonitor monitor) {
synchronized (monitors) {
assert monitors.put(Arrays.toString(funding_txo.get_txid()), monitor) == null;
- this.keys = KeysManager.constructor_new(key_seed, LDKNetwork.LDKNetwork_Bitcoin, System.currentTimeMillis() / 1000, (int) (System.currentTimeMillis() * 1000) & 0xffffffff);
+ KeysManager keys = KeysManager.constructor_new(key_seed, LDKNetwork.LDKNetwork_Bitcoin, System.currentTimeMillis() / 1000, (int) (System.currentTimeMillis() * 1000) & 0xffffffff);
- this.chan_manager = ChannelManager.constructor_new(LDKNetwork.LDKNetwork_Bitcoin, new FeeEstimator(confirmation_target -> 0), chain_monitor, tx_broadcaster, logger, keys.as_KeysInterface(), UserConfig.constructor_default(), 1);
+ this.chan_manager = ChannelManager.constructor_new(LDKNetwork.LDKNetwork_Bitcoin, FeeEstimator.new_impl(confirmation_target -> 0), chain_monitor, tx_broadcaster, logger, this.keys_interface, UserConfig.constructor_default(), 1);
this.node_id = chan_manager.get_our_node_id();
this.chan_manager_events = chan_manager.as_EventsProvider();
this.router = NetGraphMsgHandler.constructor_new(null, logger);
this.node_id = chan_manager.get_our_node_id();
this.chan_manager_events = chan_manager.as_EventsProvider();
this.router = NetGraphMsgHandler.constructor_new(null, logger);
TwoTuple<byte[], TxOut[]>[] connect_block(Block b, int height) {
byte[] header = Arrays.copyOfRange(b.bitcoinSerialize(), 0, 80);
TwoTuple<byte[], TxOut[]>[] connect_block(Block b, int height) {
byte[] header = Arrays.copyOfRange(b.bitcoinSerialize(), 0, 80);
- TwoTuple<Long, org.ldk.structs.Transaction> txp = new TwoTuple<>((long) 1, new org.ldk.structs.Transaction(b.getTransactions().get(0).bitcoinSerialize()));
+ TwoTuple<Long, byte[]> txp = new TwoTuple<>((long) 1, b.getTransactions().get(0).bitcoinSerialize());
b = new Block(bitcoinj_net, 2, b.getHash(), Sha256Hash.ZERO_HASH, 42, 0, 0,
Arrays.asList(new Transaction[]{tx}));
TwoTuple<byte[], TxOut[]>[] watch_outputs = peer2.connect_block(b, 1);
b = new Block(bitcoinj_net, 2, b.getHash(), Sha256Hash.ZERO_HASH, 42, 0, 0,
Arrays.asList(new Transaction[]{tx}));
TwoTuple<byte[], TxOut[]>[] watch_outputs = peer2.connect_block(b, 1);