From ab6828fc891c1885356f9ce20e4c22eec0e53f55 Mon Sep 17 00:00:00 2001 From: Michel van Kessel Date: Sun, 22 Nov 2020 20:52:48 +0100 Subject: [PATCH 1/6] add dust check instead of higher fees --- src/main.cpp | 11 +++++++++++ src/wallet/wallet.h | 6 +++--- 2 files changed, 14 insertions(+), 3 deletions(-) diff --git a/src/main.cpp b/src/main.cpp index acd05f3d7..cd785724c 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -1240,6 +1240,17 @@ bool AcceptToMemoryPoolWorker(CTxMemPool& pool, CValidationState& state, const C AssertLockHeld(cs_main); if (pfMissingInputs) *pfMissingInputs = false; + int dust_tx_count = 0; + CAmount min_dust = 100000; + + BOOST_FOREACH (const CTxOut& txout, tx.vout) { + // LogPrintf("tx_out value %d, minimum value %d dust count %d", txout.nValue, min_dust, dust_tx_count); + if (txout.nValue < min_dust) + dust_tx_count = dust_tx_count + 1; + if (dust_tx_count > 10) + return state.DoS(0, false, REJECT_DUST, "too many dust vouts"); + + } if (!CheckTransaction(tx, state)) return false; // state filled in by CheckTransaction diff --git a/src/wallet/wallet.h b/src/wallet/wallet.h index 4b5d6f447..4c259c1db 100644 --- a/src/wallet/wallet.h +++ b/src/wallet/wallet.h @@ -43,11 +43,11 @@ extern bool fWalletUnlockStakingOnly; static const unsigned int DEFAULT_KEYPOOL_SIZE = 100; //! -paytxfee default -static const CAmount DEFAULT_TRANSACTION_FEE = 100000; +static const CAmount DEFAULT_TRANSACTION_FEE = 10000; //! -fallbackfee default -static const CAmount DEFAULT_FALLBACK_FEE = 100000; +static const CAmount DEFAULT_FALLBACK_FEE = 10000; //! -mintxfee default -static const CAmount DEFAULT_TRANSACTION_MINFEE = 100000; +static const CAmount DEFAULT_TRANSACTION_MINFEE = 10000; //! minimum change amount static const CAmount MIN_CHANGE = CENT; //! Default for -spendzeroconfchange From f31219c9d8b8dfdf22caca6d8f161390a066c230 Mon Sep 17 00:00:00 2001 From: Michel van Kessel Date: Tue, 24 Nov 2020 08:25:41 +0100 Subject: [PATCH 2/6] default dbcache 450 (needed for txindex) --- src/txdb.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/txdb.h b/src/txdb.h index e09cb4d40..2b2316e7f 100644 --- a/src/txdb.h +++ b/src/txdb.h @@ -22,7 +22,7 @@ class CCoinsViewDBCursor; class uint256; //! -dbcache default (MiB) -static const int64_t nDefaultDbCache = 100; +static const int64_t nDefaultDbCache = 450; //! max. -dbcache (MiB) static const int64_t nMaxDbCache = sizeof(void*) > 4 ? 16384 : 1024; //! min. -dbcache (MiB) From 524dddedb29a463b556c587eda0913fa4b908439 Mon Sep 17 00:00:00 2001 From: Michel van Kessel Date: Tue, 24 Nov 2020 22:09:04 +0100 Subject: [PATCH 3/6] bump nMinimumChainWork (main and test) --- src/chainparams.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/chainparams.cpp b/src/chainparams.cpp index 1a1129f25..d6a8999ae 100644 --- a/src/chainparams.cpp +++ b/src/chainparams.cpp @@ -121,7 +121,7 @@ public: consensus.nStakeMinAge = 8 * 60 * 60; // 8 hours // The best chain should have at least this much work. - consensus.nMinimumChainWork = uint256S("0x0000000000000000000000000000000000000000000002bcbdc747da2aad51b7"); + consensus.nMinimumChainWork = uint256S("0x0000000000000000000000000000000000000000000002e39410b632f6e755fc"); /** * The message start string is designed to be unlikely to occur in normal data. @@ -220,7 +220,7 @@ public: nDefaultPort = 25714; // The best chain should have at least this much work. - consensus.nMinimumChainWork = uint256S("0x00"); + consensus.nMinimumChainWork = uint256S("0x000000000000000000000000000000000000000000000027eceae4ce45300bf6"); /* consensus.vDeployments[Consensus::DEPLOYMENT_CSV].bit = 0; From 4e1e6e83fa166b925f32754bd0f9ed440c1a641f Mon Sep 17 00:00:00 2001 From: Michel van Kessel Date: Tue, 24 Nov 2020 22:22:29 +0100 Subject: [PATCH 4/6] Bump version to 2.13.2.7 --- CHANGELOG.md | 10 ++++++++++ configure.ac | 2 +- doc/Doxyfile | 2 +- src/clientversion.h | 2 +- 4 files changed, 13 insertions(+), 3 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 364d355b7..3962a8f8a 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,4 +1,14 @@ # Changelog +## v2.13.2.7 (2020-11-24) +- Dust mitigation in mempool (by JJ12880 from Radium Core) +- Compile on MacOS Catalina +- Cross-compile MacOS with Xcode 11.3.1 +- Updated dependencies for Win64, Linux64, MacOS, arm64, armv7 +- Sign/Verify compatibility with Legacy clients +- Disable Stake Cache (for now) +- Changed dbcache to 450MB (for txindex) +- Add 100 mature inputs during coinstake. +- Updated fix seeds for main and testnet. ## v2.13.2.6 (2020-07-21) - Fix staking memory leak (by JJ12880 from Radium Core) diff --git a/configure.ac b/configure.ac index d03c58389..6b3ce6078 100644 --- a/configure.ac +++ b/configure.ac @@ -3,7 +3,7 @@ AC_PREREQ([2.60]) define(_CLIENT_VERSION_MAJOR, 2) define(_CLIENT_VERSION_MINOR, 13) define(_CLIENT_VERSION_REVISION, 2) -define(_CLIENT_VERSION_BUILD, 6) +define(_CLIENT_VERSION_BUILD, 7) define(_CLIENT_VERSION_IS_RELEASE, true) define(_COPYRIGHT_YEAR, 2020) define(_COPYRIGHT_HOLDERS,[The %s developers]) diff --git a/doc/Doxyfile b/doc/Doxyfile index 9daac3335..3d1a45061 100644 --- a/doc/Doxyfile +++ b/doc/Doxyfile @@ -34,7 +34,7 @@ PROJECT_NAME = "Blackcoin More" # This could be handy for archiving the generated documentation or # if some version control system is used. -PROJECT_NUMBER = 2.13.2.6 +PROJECT_NUMBER = 2.13.2.7 # Using the PROJECT_BRIEF tag one can provide an optional one line description # for a project that appears at the top of each page and should give viewer diff --git a/src/clientversion.h b/src/clientversion.h index 9f51dd6c5..10a8a57a1 100644 --- a/src/clientversion.h +++ b/src/clientversion.h @@ -17,7 +17,7 @@ #define CLIENT_VERSION_MAJOR 2 #define CLIENT_VERSION_MINOR 13 #define CLIENT_VERSION_REVISION 2 -#define CLIENT_VERSION_BUILD 6 +#define CLIENT_VERSION_BUILD 7 //! Set to true for release, false for prerelease or test build #define CLIENT_VERSION_IS_RELEASE true From 0377343516016faf17ae2816b080d01839014a0a Mon Sep 17 00:00:00 2001 From: Michel van Kessel Date: Tue, 24 Nov 2020 23:29:35 +0100 Subject: [PATCH 5/6] revert txNew.vin.size to 10 More has no real added value and can cause strange results - Need more testing! --- src/wallet/wallet.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/wallet/wallet.cpp b/src/wallet/wallet.cpp index 4a04b2e4b..6da25b886 100644 --- a/src/wallet/wallet.cpp +++ b/src/wallet/wallet.cpp @@ -806,7 +806,7 @@ bool CWallet::CreateCoinStake(const CKeyStore& keystore, unsigned int nBits, int && pcoin.first->GetHash() != txNew.vin[0].prevout.hash) { // Stop adding more inputs if already too many inputs - if (txNew.vin.size() >= 100) + if (txNew.vin.size() >= 10) break; // Stop adding inputs if reached reserve limit if (nCredit + pcoin.first->vout[pcoin.second].nValue > nBalance - nReserveBalance) From a3aaddf6f4b761cafbb8bed93c8e550fc6c97c4b Mon Sep 17 00:00:00 2001 From: Michel van Kessel Date: Tue, 24 Nov 2020 23:33:17 +0100 Subject: [PATCH 6/6] changelog for v2.13.2.7 --- CHANGELOG.md | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 3962a8f8a..bf4b5980f 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -6,8 +6,7 @@ - Updated dependencies for Win64, Linux64, MacOS, arm64, armv7 - Sign/Verify compatibility with Legacy clients - Disable Stake Cache (for now) -- Changed dbcache to 450MB (for txindex) -- Add 100 mature inputs during coinstake. +- Changed dbcache to 450MB (for txindex) - Updated fix seeds for main and testnet. ## v2.13.2.6 (2020-07-21)