From 364bf80cc3c04e83320baaecc333206d82fff985 Mon Sep 17 00:00:00 2001 From: miketout Date: Mon, 17 Jun 2024 22:42:00 -0700 Subject: [PATCH 1/3] Move conflict removal inside block tx loop --- src/main.cpp | 21 +++++++-------------- 1 file changed, 7 insertions(+), 14 deletions(-) diff --git a/src/main.cpp b/src/main.cpp index 5b19ba9e6ab..8c5e6829f75 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -3840,20 +3840,6 @@ bool ConnectBlock(const CBlock& block, CValidationState& state, CBlockIndex* pin int32_t futureblock; { - { - LOCK(mempool.cs); - // remove any potential conflicts for inputs in the mempool from auto-created transactions, - // such as imports or exports to prevent us from accepting the block - for (auto &oneTx : block.vtx) - { - std::list removedTxes; - if (!oneTx.IsCoinBase()) - { - mempool.removeConflicts(oneTx, removedTxes); - } - } - } - // Check it again to verify JoinSplit proofs, and in case a previous version let a bad block in if (!CheckBlock(&futureblock, pindex->GetHeight(), pindex, block, state, chainparams, fExpensiveChecks ? verifier : disabledVerifier, fCheckPOW, !fJustCheck, !fJustCheck) || futureblock != 0 ) { @@ -4091,6 +4077,13 @@ bool ConnectBlock(const CBlock& block, CValidationState& state, CBlockIndex* pin for (unsigned int i = 0; i < block.vtx.size(); i++) { const CTransaction &tx = block.vtx[i]; + + if (i != 0) + { + std::list removedTxes; + mempool.removeConflicts(tx, removedTxes); + } + const uint256 txhash = tx.GetHash(); nInputs += tx.vin.size(); nSigOps += GetLegacySigOpCount(tx); From 18af7a38f87e0d01fbd056d1ee74e5c1cde337ce Mon Sep 17 00:00:00 2001 From: miketout Date: Mon, 17 Jun 2024 22:59:04 -0700 Subject: [PATCH 2/3] Var cleanup --- src/main.cpp | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) diff --git a/src/main.cpp b/src/main.cpp index 8c5e6829f75..f7bacf80bdc 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -4078,12 +4078,6 @@ bool ConnectBlock(const CBlock& block, CValidationState& state, CBlockIndex* pin { const CTransaction &tx = block.vtx[i]; - if (i != 0) - { - std::list removedTxes; - mempool.removeConflicts(tx, removedTxes); - } - const uint256 txhash = tx.GetHash(); nInputs += tx.vin.size(); nSigOps += GetLegacySigOpCount(tx); @@ -4092,7 +4086,12 @@ bool ConnectBlock(const CBlock& block, CValidationState& state, CBlockIndex* pin REJECT_INVALID, "bad-blk-sigops"); // ensure transaction can clear conflicts and get into mempool - std::list removed; + if (i != 0) + { + std::list removedTxes; + mempool.removeConflicts(tx, removedTxes); + } + bool missingInputs = false; bool isPosTx = block.IsVerusPOSBlock() && (i + 1) == block.vtx.size(); if (((tx.IsCoinBase() || @@ -5436,7 +5435,6 @@ bool static DisconnectTip(CValidationState &state, const CChainParams& chainpara { // ignore validation errors in resurrected transactions CTransaction &tx = block.vtx[i]; - list removed; CValidationState stateDummy; // don't keep coinbase, staking, invalid transactions, or arbitrage only transfers From 389c86290203714f46a4987bd9b5bcdd1db374d8 Mon Sep 17 00:00:00 2001 From: Asher Dawes Date: Mon, 17 Jun 2024 23:44:07 -0700 Subject: [PATCH 3/3] update version --- .gitlab-ci.yml | 2 +- README.md | 2 +- doc/man/verus-cli/linux/README.txt | 2 +- doc/man/verus-cli/mac/README.txt | 2 +- doc/man/verus-cli/windows/README.txt | 2 +- src/version.h | 2 +- 6 files changed, 6 insertions(+), 6 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 4e33e2d963f..ff8cbafc3a3 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -7,7 +7,7 @@ stages: ######################################################################################################################## variables: - VERSION: 1.2.3-1 + VERSION: 1.2.3-2 VERUS_CLI_ARM64_LINUX: Verus-CLI-Linux-v${VERSION}-arm64.tar.gz VERUS_CLI_LINUX_X86_64: Verus-CLI-Linux-v${VERSION}-x86_64.tar.gz diff --git a/README.md b/README.md index 82204c254a9..e513f20feda 100644 --- a/README.md +++ b/README.md @@ -1,5 +1,5 @@ -## VerusCoin version 1.2.3-1 +## VerusCoin version 1.2.3-2 Arguably the world's most advanced technology, zero knowledge privacy enabled, multi-chain blockchain protocol, Verus Public Blockchains as a Service (PBaaS) combines Sapling zero knowledge technology with an intelligent, multi-chain, provable protocol, using interchain smart transactions. Verus PBaaS also enables merge mining and cross-chain staking with a completely original, combined proof of stake/proof of work consensus algorithm, Proof of Power, that can be mined on CPUs and mobile phones, and also solves the nothing at stake problem. With this and its approach towards CPU mining and ASICs, Verus Coin strives to be one of the most naturally decentralizing and attack resistant blockchain networks in existence. diff --git a/doc/man/verus-cli/linux/README.txt b/doc/man/verus-cli/linux/README.txt index 44420e52114..22d27d87e2b 100644 --- a/doc/man/verus-cli/linux/README.txt +++ b/doc/man/verus-cli/linux/README.txt @@ -1,5 +1,5 @@ -VerusCoin Command Line Tools v1.2.3-1 +VerusCoin Command Line Tools v1.2.3-2 Contents: verusd - VerusCoin daemon diff --git a/doc/man/verus-cli/mac/README.txt b/doc/man/verus-cli/mac/README.txt index 0e58cb8771b..d497af0d226 100644 --- a/doc/man/verus-cli/mac/README.txt +++ b/doc/man/verus-cli/mac/README.txt @@ -1,5 +1,5 @@ -VerusCoin Command Line Tools v1.2.3-1 +VerusCoin Command Line Tools v1.2.3-2 Contents: verusd - VerusCoin daemon. diff --git a/doc/man/verus-cli/windows/README.txt b/doc/man/verus-cli/windows/README.txt index 4283490cf0a..664be3d4417 100644 --- a/doc/man/verus-cli/windows/README.txt +++ b/doc/man/verus-cli/windows/README.txt @@ -1,5 +1,5 @@ -VerusCoin Command Line Tools v1.2.3-1 +VerusCoin Command Line Tools v1.2.3-2 Contents: verusd.exe - VerusCoin daemon diff --git a/src/version.h b/src/version.h index 4fbceec2ba6..2a88651c637 100644 --- a/src/version.h +++ b/src/version.h @@ -36,6 +36,6 @@ static const int MEMPOOL_GD_VERSION = 60002; static const int NO_BLOOM_VERSION = 170004; #define KOMODO_VERSION "0.2.1" -#define VERUS_VERSION "1.2.3-1" +#define VERUS_VERSION "1.2.3-2" #endif // BITCOIN_VERSION_H