X-Git-Url: http://git.bitcoin.ninja/index.cgi?a=blobdiff_plain;f=src%2Ftest%2Fjava%2Forg%2Fldk%2FHumanObjectPeerTest.java;h=6e90c6182e8117997c773ab8548872e08f8e6394;hb=ccfdc89be1530dd6dc21d57dd3eaceeaaac2304f;hp=80c7cf61e1e5dd8bc6c986bdb8432fdbc8e40745;hpb=d4846238a5f4245ac3cee8dbf3f196ad964564d5;p=ldk-java diff --git a/src/test/java/org/ldk/HumanObjectPeerTest.java b/src/test/java/org/ldk/HumanObjectPeerTest.java index 80c7cf61..6e90c618 100644 --- a/src/test/java/org/ldk/HumanObjectPeerTest.java +++ b/src/test/java/org/ldk/HumanObjectPeerTest.java @@ -417,6 +417,16 @@ class HumanObjectPeerTestInstance { this.constructor = new ChannelManagerConstructor(serialized, monitors, UserConfig.with_default(), this.keys_interface, this.fee_estimator, this.chain_monitor, filter_nullable, this.router, this.tx_broadcaster, this.logger); + try { + // Test that ChannelManagerConstructor correctly rejects duplicate ChannelMonitors + byte[][] monitors_dupd = new byte[2][]; + monitors_dupd[0] = monitors[0]; + monitors_dupd[1] = monitors[0]; + ChannelManagerConstructor constr = this.constructor = new ChannelManagerConstructor(serialized, monitors_dupd, UserConfig.with_default(), + this.keys_interface, this.fee_estimator, this.chain_monitor, filter_nullable, + null, this.tx_broadcaster, this.logger); + assert false; + } catch (ChannelManagerConstructor.InvalidSerializedDataException e) {} } LockableScore scorer = null; if (use_invoice_payer) { scorer = LockableScore.of(Scorer.with_default().as_Score()); }