Skip to content

Commit

Permalink
Updated fee estimation based on Lelantus improvements
Browse files Browse the repository at this point in the history
  • Loading branch information
levonpetrosyan93 committed Apr 15, 2021
1 parent 229c91c commit 1e30c81
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions src/qt/coincontroldialog.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -524,9 +524,9 @@ void CoinControlDialog::updateLabels(WalletModel *model, QDialog* dialog, bool a
if (nQuantity > 0)
{
if (anonymousMode) {
// 956 is constant part, mainly Schnorr and Range proof, 2560 is for each sigma/aux data
// 1054 is constant part, mainly Schnorr and Range proofs, 2560 is for each sigma/aux data
// 83 assuming 1 jmint, 34 is the size of each normal vout, 10 is the size of empty transaction, 52 other constant parts
nBytes = 956 + 2560 * vOutputs.size() + 83 + CoinControlDialog::payAmounts.size() * 34 + 10 + 52;
nBytes = 1054 + 2560 * vOutputs.size() + 83 + CoinControlDialog::payAmounts.size() * 34 + 10 + 52;
nPayFee = CWallet::GetMinimumFee(nBytes, nTxConfirmTarget, mempool);
if (nPayAmount > 0) {
nChange = nAmount - nPayAmount;
Expand Down
4 changes: 2 additions & 2 deletions src/wallet/wallet.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -6916,9 +6916,9 @@ std::pair<CAmount, unsigned int> CWallet::EstimateJoinSplitFee(CAmount required,
} catch (std::runtime_error) {
}

// 956 is constant part, mainly Schnorr and Range proof, 2560 is for each sigma/aux data
// 1054 is constant part, mainly Schnorr and Range proofs, 2560 is for each sigma/aux data
// 179 other parts of tx, assuming 1 utxo and 1 jmint
size = 956 + 2560 * (spendCoins.size() + sigmaSpendCoins.size()) + 179;
size = 1054 + 2560 * (spendCoins.size() + sigmaSpendCoins.size()) + 179;
CAmount feeNeeded = CWallet::GetMinimumFee(size, nTxConfirmTarget, mempool);

if (fee >= feeNeeded) {
Expand Down

0 comments on commit 1e30c81

Please sign in to comment.