diff options
| author | Alex Morcos <[email protected]> | 2017-01-25 22:20:02 -0500 |
|---|---|---|
| committer | Alex Morcos <[email protected]> | 2017-01-25 22:24:40 -0500 |
| commit | ae9719ab87a05ca4c3293b2f8675f17b16ed5872 (patch) | |
| tree | 264da44e84591767467c1ed2e1d2c620523b27ad /src/wallet/wallet.cpp | |
| parent | [rpc] Add incremental relay fee to getnetworkinfo (diff) | |
| download | discoin-ae9719ab87a05ca4c3293b2f8675f17b16ed5872.tar.xz discoin-ae9719ab87a05ca4c3293b2f8675f17b16ed5872.zip | |
Refactor GetMinimumFee to give option of providing targetFee
Diffstat (limited to 'src/wallet/wallet.cpp')
| -rw-r--r-- | src/wallet/wallet.cpp | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/src/wallet/wallet.cpp b/src/wallet/wallet.cpp index 625199809..c46d5ed78 100644 --- a/src/wallet/wallet.cpp +++ b/src/wallet/wallet.cpp @@ -2790,8 +2790,13 @@ CAmount CWallet::GetRequiredFee(unsigned int nTxBytes) CAmount CWallet::GetMinimumFee(unsigned int nTxBytes, unsigned int nConfirmTarget, const CTxMemPool& pool) { - // payTxFee is user-set "I want to pay this much" - CAmount nFeeNeeded = payTxFee.GetFee(nTxBytes); + // payTxFee is the user-set global for desired feerate + return GetMinimumFee(nTxBytes, nConfirmTarget, pool, payTxFee.GetFee(nTxBytes)); +} + +CAmount CWallet::GetMinimumFee(unsigned int nTxBytes, unsigned int nConfirmTarget, const CTxMemPool& pool, CAmount targetFee) +{ + CAmount nFeeNeeded = targetFee; // User didn't set: use -txconfirmtarget to estimate... if (nFeeNeeded == 0) { int estimateFoundTarget = nConfirmTarget; |