diff options
| author | Michi Lumin <[email protected]> | 2021-07-21 20:58:12 +0100 |
|---|---|---|
| committer | Ross Nicoll <[email protected]> | 2021-08-04 09:29:35 +0100 |
| commit | 1d2380df56e2a5471a306a86fa76649075f12517 (patch) | |
| tree | 0546711ebaf02c7da86913024fa7dc32aaffec9b /src | |
| parent | Merge pull request #2434 from patricklodder/1.14-activatebestchain-shutdown-fix (diff) | |
| download | discoin-1d2380df56e2a5471a306a86fa76649075f12517.tar.xz discoin-1d2380df56e2a5471a306a86fa76649075f12517.zip | |
p2p: Reduce BIP125 replace by fee increment value
Diffstat (limited to 'src')
| -rw-r--r-- | src/wallet/rpcwallet.cpp | 8 | ||||
| -rw-r--r-- | src/wallet/wallet.h | 2 |
2 files changed, 7 insertions, 3 deletions
diff --git a/src/wallet/rpcwallet.cpp b/src/wallet/rpcwallet.cpp index c7c665a8c..3a6c48dd7 100644 --- a/src/wallet/rpcwallet.cpp +++ b/src/wallet/rpcwallet.cpp @@ -2830,6 +2830,10 @@ UniValue bumpfee(const JSONRPCRequest& request) // Calculate the expected size of the new transaction. int64_t txSize = GetVirtualTransactionSize(*(wtx.tx)); + // Doge: Round txSize up to nearest 1kB + if (txSize % 1024 != 0) { + txSize = txSize + 1024 - (txSize % 1024); + } const int64_t maxNewTxSize = CalculateMaximumSignedTxSize(*wtx.tx); // optional parameters @@ -2896,9 +2900,9 @@ UniValue bumpfee(const JSONRPCRequest& request) if (specifiedConfirmTarget) { nNewFee = CWallet::GetMinimumFee(*wtx.tx, maxNewTxSize, newConfirmTarget, mempool, CAmount(0)); } - // otherwise use the regular wallet logic to select payTxFee or default confirm target + // otherwise bump the fee by 1 DOGE. else { - nNewFee = CWallet::GetMinimumFee(*wtx.tx, maxNewTxSize, newConfirmTarget, mempool); + nNewFee = nOldFee + walletIncrementalRelayFee.GetFeePerK(); } nNewFeeRate = CFeeRate(nNewFee, maxNewTxSize); diff --git a/src/wallet/wallet.h b/src/wallet/wallet.h index 329923aa3..e3a041e7f 100644 --- a/src/wallet/wallet.h +++ b/src/wallet/wallet.h @@ -56,7 +56,7 @@ static const CAmount DEFAULT_TRANSACTION_MINFEE = COIN; //mlumin 5/2021: adding a minimum Wallet fee vs relay, currently still 1 COIN, to be reduced. static const unsigned int DEFAULT_MIN_WALLET_TX_FEE = COIN; //! minimum recommended increment for BIP 125 replacement txs -static const CAmount WALLET_INCREMENTAL_RELAY_FEE = COIN * 5; +static const CAmount WALLET_INCREMENTAL_RELAY_FEE = COIN/10 * 5; //! target minimum change amount static const CAmount MIN_CHANGE = COIN; //! final minimum change amount after paying for fees |