aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorPatrick Lodder <[email protected]>2021-08-04 22:10:44 +0200
committerGitHub <[email protected]>2021-08-04 22:10:44 +0200
commita88d53be2e46875ce95cffa31073081f40087214 (patch)
tree958e3542853d12a7b6c9d92ca2198abcfe926955 /src
parentMerge pull request #2434 from patricklodder/1.14-activatebestchain-shutdown-fix (diff)
parentconsensus: Fix a rare crash bug (diff)
downloaddiscoin-a88d53be2e46875ce95cffa31073081f40087214.tar.xz
discoin-a88d53be2e46875ce95cffa31073081f40087214.zip
Merge pull request #2415 from rnicoll/1.14.4-rbf-fee
Reduce BIP125 replace by fee increment value
Diffstat (limited to 'src')
-rw-r--r--src/validation.cpp6
-rw-r--r--src/wallet/rpcwallet.cpp8
-rw-r--r--src/wallet/wallet.h2
3 files changed, 12 insertions, 4 deletions
diff --git a/src/validation.cpp b/src/validation.cpp
index 35778a2e7..c81ab3c20 100644
--- a/src/validation.cpp
+++ b/src/validation.cpp
@@ -2573,7 +2573,11 @@ bool ActivateBestChain(CValidationState &state, const CChainParams& chainparams,
}
} while (pindexNewTip != pindexMostWork);
- CheckBlockIndex(chainparams.GetConsensus(pindexNewTip->nHeight));
+ if (pindexNewTip != NULL) {
+ CheckBlockIndex(chainparams.GetConsensus(pindexNewTip->nHeight));
+ } else {
+ CheckBlockIndex(chainparams.GetConsensus(0));
+ }
// Write changes periodically to disk, after relay.
if (!FlushStateToDisk(state, FLUSH_STATE_PERIODIC)) {
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