From b0724348a1e556d1d2eebc04e3ebb8524eec2fd9 Mon Sep 17 00:00:00 2001 From: M Date: Fri, 23 Jul 2021 19:10:22 +0300 Subject: [PATCH] Added verification for unspent coins while transaction creation. --- lib/bitcoin/electrum_wallet.dart | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/lib/bitcoin/electrum_wallet.dart b/lib/bitcoin/electrum_wallet.dart index 78e3f6969..f86b04aa3 100644 --- a/lib/bitcoin/electrum_wallet.dart +++ b/lib/bitcoin/electrum_wallet.dart @@ -158,6 +158,9 @@ abstract class ElectrumWalletBase extends WalletBase[]; + final credentialsAmount = transactionCredentials.amount != null + ? stringDoubleToBitcoinAmount(transactionCredentials.amount) + : 0; var allInputsAmount = 0; if (unspentCoins.isEmpty) { @@ -171,7 +174,8 @@ abstract class ElectrumWalletBase extends WalletBase 0 && allInputsAmount < credentialsAmount)) { throw BitcoinTransactionNoInputsException(); } @@ -179,9 +183,6 @@ abstract class ElectrumWalletBase extends WalletBase