btc send exact value of output fix

This commit is contained in:
julian 2023-01-31 13:44:56 -06:00
parent 2e7d55bda4
commit 6df782647e

View file

@ -2360,7 +2360,10 @@ class BitcoinWallet extends CoinServiceAPI
],
satoshiAmounts: [
satoshiAmountToSend,
satoshisBeingUsed - satoshiAmountToSend - 1
// this can cause a problem where the output value is negative so commenting out for now
// satoshisBeingUsed - satoshiAmountToSend - 1
// and using dust limit instead
DUST_LIMIT,
], // dust limit is the minimum amount a change output should be
))["vSize"] as int;
@ -2825,6 +2828,7 @@ class BitcoinWallet extends CoinServiceAPI
// Add transaction output
for (var i = 0; i < recipients.length; i++) {
print("OURPUT VALUW: ${satoshiAmounts[i]}");
txb.addOutput(recipients[i], satoshiAmounts[i]);
}