mirror of
https://github.com/sparrowwallet/drongo.git
synced 2024-12-25 17:46:44 +00:00
dont increment fee if user set
This commit is contained in:
parent
b0d37fe8fe
commit
0a43f9f6a8
1 changed files with 2 additions and 2 deletions
|
@ -494,7 +494,7 @@ public class Wallet {
|
|||
long noChangeFeeRequiredAmt = (fee == null ? (long)(feeRate * noChangeVSize) : fee);
|
||||
|
||||
//Add 1 satoshi to accommodate longer signatures when feeRate equals default min relay fee to ensure fee is sufficient
|
||||
noChangeFeeRequiredAmt = (feeRate == Transaction.DEFAULT_MIN_RELAY_FEE ? noChangeFeeRequiredAmt + 1 : noChangeFeeRequiredAmt);
|
||||
noChangeFeeRequiredAmt = (fee == null && feeRate == Transaction.DEFAULT_MIN_RELAY_FEE ? noChangeFeeRequiredAmt + 1 : noChangeFeeRequiredAmt);
|
||||
|
||||
//If sending all selected utxos, set the recipient amount to equal to total of those utxos less the no change fee
|
||||
long maxSendAmt = totalSelectedAmt - noChangeFeeRequiredAmt;
|
||||
|
@ -531,7 +531,7 @@ public class Wallet {
|
|||
TransactionOutput changeOutput = new TransactionOutput(transaction, changeAmt, getOutputScript(changeNode));
|
||||
double changeVSize = noChangeVSize + changeOutput.getLength();
|
||||
long changeFeeRequiredAmt = (fee == null ? (long)(feeRate * changeVSize) : fee);
|
||||
changeFeeRequiredAmt = (feeRate == Transaction.DEFAULT_MIN_RELAY_FEE ? changeFeeRequiredAmt + 1 : changeFeeRequiredAmt);
|
||||
changeFeeRequiredAmt = (fee == null && feeRate == Transaction.DEFAULT_MIN_RELAY_FEE ? changeFeeRequiredAmt + 1 : changeFeeRequiredAmt);
|
||||
|
||||
//Recalculate the change amount with the new fee
|
||||
changeAmt = differenceAmt - changeFeeRequiredAmt;
|
||||
|
|
Loading…
Reference in a new issue