diff --git a/core/src/integrationTest/java/bisq/core/BitcoinjBsqTests.java b/core/src/integrationTest/java/bisq/core/BitcoinjBsqTests.java index 03e9730243..7537fd6380 100644 --- a/core/src/integrationTest/java/bisq/core/BitcoinjBsqTests.java +++ b/core/src/integrationTest/java/bisq/core/BitcoinjBsqTests.java @@ -155,4 +155,24 @@ void sendBsqButNotEnoughBsqTest() { assertThrows(InsufficientMoneyException.class, () -> bsqWalletV2.sendBsq(receiverAddress, receiverAmount, Coin.ofSat(10))); } + + @Test + void sendMoreBsqThanInWalletTest() { + var bsqWalletV2 = new BsqWalletV2(networkParams, + peerGroup, + btcWalletV2, + bsqWallet, + bsqCoinSelector); + + var secondBsqWalletReceivedLatch = new CountDownLatch(1); + secondBsqWallet.addCoinsReceivedEventListener((wallet, tx, prevBalance, newBalance) -> + secondBsqWalletReceivedLatch.countDown()); + + Address receiverAddress = secondBsqWallet.currentReceiveAddress(); + Coin receiverAmount = bsqWallet.getBalance() + .add(Coin.valueOf(100)); + + assertThrows(InsufficientMoneyException.class, () -> + bsqWalletV2.sendBsq(receiverAddress, receiverAmount, Coin.ofSat(10))); + } }