From e1880cfe19d023eaea30c86a4605d50d029ec864 Mon Sep 17 00:00:00 2001 From: lateminer <9951982+lateminer@users.noreply.github.com> Date: Sun, 26 Nov 2023 15:32:13 +0100 Subject: [PATCH] cleanup: Remove multiple RBF, pruning and some other residues --- src/node/blockstorage.cpp | 2 ++ src/rpc/mining.cpp | 38 -------------------------------------- src/validation.cpp | 3 +++ src/wallet/staking.cpp | 7 ++----- 4 files changed, 7 insertions(+), 43 deletions(-) diff --git a/src/node/blockstorage.cpp b/src/node/blockstorage.cpp index 6a9e5f4c7d..36c9a6bc5b 100644 --- a/src/node/blockstorage.cpp +++ b/src/node/blockstorage.cpp @@ -482,6 +482,8 @@ bool BlockManager::FindBlockPos(FlatFilePos& pos, unsigned int nAddSize, unsigne if (!fKnown) { bool out_of_space; size_t bytes_allocated = BlockFileSeq().Allocate(pos, nAddSize, out_of_space); + // Blackcoin: unused variable intentionally, used for setting out_of_space value + static_cast(bytes_allocated); if (out_of_space) { return AbortNode("Disk space is too low!", _("Disk space is too low!")); } diff --git a/src/rpc/mining.cpp b/src/rpc/mining.cpp index 2dc5e501a8..5ace5438a4 100644 --- a/src/rpc/mining.cpp +++ b/src/rpc/mining.cpp @@ -447,44 +447,6 @@ static RPCHelpMan getmininginfo() } -// NOTE: Unlike wallet RPC (which use BTC values), mining RPCs follow GBT (BIP 22) in using satoshi amounts -static RPCHelpMan prioritisetransaction() -{ - return RPCHelpMan{"prioritisetransaction", - "Accepts the transaction into mined blocks at a higher (or lower) priority\n", - { - {"txid", RPCArg::Type::STR_HEX, RPCArg::Optional::NO, "The transaction id."}, - {"dummy", RPCArg::Type::NUM, RPCArg::Optional::OMITTED, "API-Compatibility for previous API. Must be zero or null.\n" - " DEPRECATED. For forward compatibility use named arguments and omit this parameter."}, - {"fee_delta", RPCArg::Type::NUM, RPCArg::Optional::NO, "The fee value (in satoshis) to add (or subtract, if negative).\n" - " Note, that this value is not a fee rate. It is a value to modify absolute fee of the TX.\n" - " The fee is not actually paid, only the algorithm for selecting transactions into a block\n" - " considers the transaction as it would have paid a higher (or lower) fee."}, - }, - RPCResult{ - RPCResult::Type::BOOL, "", "Returns true"}, - RPCExamples{ - HelpExampleCli("prioritisetransaction", "\"txid\" 0.0 10000") - + HelpExampleRpc("prioritisetransaction", "\"txid\", 0.0, 10000") - }, - [&](const RPCHelpMan& self, const JSONRPCRequest& request) -> UniValue -{ - LOCK(cs_main); - - uint256 hash(ParseHashV(request.params[0], "txid")); - CAmount nAmount = request.params[2].getInt(); - - if (!(request.params[1].isNull() || request.params[1].get_real() == 0)) { - throw JSONRPCError(RPC_INVALID_PARAMETER, "Priority is no longer supported, dummy argument to prioritisetransaction must be 0."); - } - - EnsureAnyMemPool(request.context).PrioritiseTransaction(hash, nAmount); - return true; -}, - }; -} - - // NOTE: Assumes a conclusive result; if result is inconclusive, it must be handled by caller static UniValue BIP22ValidationResult(const BlockValidationState& state) { diff --git a/src/validation.cpp b/src/validation.cpp index 5fe011ad2d..f90fe9f195 100644 --- a/src/validation.cpp +++ b/src/validation.cpp @@ -1069,7 +1069,10 @@ bool MemPoolAccept::Finalize(const ATMPArgs& args, Workspace& ws) { AssertLockHeld(cs_main); AssertLockHeld(m_pool.cs); + /* + // Blackcoin const CTransaction& tx = *ws.m_ptx; + */ const uint256& hash = ws.m_hash; TxValidationState& state = ws.m_state; const bool bypass_limits = args.m_bypass_limits; diff --git a/src/wallet/staking.cpp b/src/wallet/staking.cpp index 2a8ff10511..df9e7ad4b4 100644 --- a/src/wallet/staking.cpp +++ b/src/wallet/staking.cpp @@ -132,8 +132,6 @@ void AvailableCoinsForStaking(const CWallet& wallet, continue; } - bool tx_from_me = CachedTxIsFromMe(wallet, wtx, ISMINE_ALL); - for (unsigned int i = 0; i < wtx.tx->vout.size(); i++) { const CTxOut& output = wtx.tx->vout[i]; const COutPoint outpoint(wtxid, i); @@ -159,7 +157,6 @@ void AvailableCoinsForStaking(const CWallet& wallet, std::unique_ptr provider = wallet.GetSolvingProvider(output.scriptPubKey); - int input_bytes = CalculateMaximumSignedInputSize(output, COutPoint(), provider.get(), can_grind_r, coinControl); bool solvable = provider ? InferDescriptor(output.scriptPubKey, *provider)->IsSolvable() : false; bool spendable = ((mine & ISMINE_SPENDABLE) != ISMINE_NO) || (((mine & ISMINE_WATCH_ONLY) != ISMINE_NO) && (coinControl && coinControl->fAllowWatchOnly && solvable)); @@ -480,7 +477,7 @@ bool CreateCoinStake(CWallet& wallet, unsigned int nBits, int64_t nSearchInterva // Set output amount if (isDevFundEnabled) { - if (txNew.vout.size() == 4 + bMinterKey) + if (txNew.vout.size() == 4u + bMinterKey) { txNew.vout[1 + bMinterKey].nValue = (nCredit / 2 / CENT) * CENT; txNew.vout[2 + bMinterKey].nValue = nCredit - txNew.vout[1 + bMinterKey].nValue; @@ -494,7 +491,7 @@ bool CreateCoinStake(CWallet& wallet, unsigned int nBits, int64_t nSearchInterva } else { - if (txNew.vout.size() == 3 + bMinterKey) + if (txNew.vout.size() == 3u + bMinterKey) { txNew.vout[1 + bMinterKey].nValue = (nCredit / 2 / CENT) * CENT; txNew.vout[2 + bMinterKey].nValue = nCredit - txNew.vout[1 + bMinterKey].nValue;