Skip to content

Commit

Permalink
Make sure to fund transactions with a ceil'd result
Browse files Browse the repository at this point in the history
Summary:
The wallet code failed to be updated to use GetFeeCeiling everywhere needed.
This patch fixes a few more locations so that CreateTransaction does not
end up generating a transaction with insufficient fee.

Test Plan:
  make check && ./test/functional/test_runner.py

Reviewers: #bitcoin_abc, deadalnix

Reviewed By: #bitcoin_abc, deadalnix

Subscribers: teamcity

Differential Revision: https://reviews.bitcoinabc.org/D1816
  • Loading branch information
Shammah Chancellor committed Sep 27, 2018
1 parent c0dff93 commit 1254f95
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/wallet/fees.cpp
Expand Up @@ -20,11 +20,11 @@ Amount GetMinimumFee(unsigned int nTxBytes, unsigned int nConfirmTarget,
if (nFeeNeeded == Amount::zero()) {
int estimateFoundTarget = nConfirmTarget;
nFeeNeeded = pool.estimateSmartFee(nConfirmTarget, &estimateFoundTarget)
.GetFee(nTxBytes);
.GetFeeCeiling(nTxBytes);
// ... unless we don't have enough mempool data for estimatefee, then
// use fallbackFee.
if (nFeeNeeded == Amount::zero()) {
nFeeNeeded = CWallet::fallbackFee.GetFee(nTxBytes);
nFeeNeeded = CWallet::fallbackFee.GetFeeCeiling(nTxBytes);
}
}

Expand All @@ -44,5 +44,5 @@ Amount GetMinimumFee(unsigned int nTxBytes, unsigned int nConfirmTarget,
const CTxMemPool &pool) {
// payTxFee is the user-set global for desired feerate.
return GetMinimumFee(nTxBytes, nConfirmTarget, pool,
payTxFee.GetFee(nTxBytes));
payTxFee.GetFeeCeiling(nTxBytes));
}

0 comments on commit 1254f95

Please sign in to comment.