Skip to content

Commit 644ec4a

Browse files
committed
Test new block connection API
1 parent def4e54 commit 644ec4a

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

src/test/java/org/ldk/HumanObjectPeerTest.java

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -351,10 +351,13 @@ TwoTuple<byte[], TwoTuple<Integer, TxOut>[]>[] connect_block(Block b, int height
351351
txn = new TwoTuple[]{txp};
352352
} else
353353
txn = new TwoTuple[0];
354-
chan_manager.as_Listen().block_connected(b.bitcoinSerialize(), height);
355354
if (chain_monitor != null) {
355+
chan_manager.as_Listen().block_connected(b.bitcoinSerialize(), height);
356356
chain_monitor.block_connected(header, txn, height);
357357
} else {
358+
chan_manager.transactions_confirmed(header, height, txn);
359+
chan_manager.update_best_block(header, height);
360+
// Connect manually if we aren't using a ChainMonitor and are implementing Watch ourselves
358361
synchronized (monitors) {
359362
assert monitors.size() == 1;
360363
for (ChannelMonitor mon : monitors.values()) {

0 commit comments

Comments
 (0)