Skip to content

Commit

Permalink
cleanup: Remove multiple RBF, pruning and some other residues
Browse files Browse the repository at this point in the history
  • Loading branch information
lateminer committed Nov 26, 2023
1 parent 1b2aa25 commit e1880cf
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 43 deletions.
2 changes: 2 additions & 0 deletions src/node/blockstorage.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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<void>(bytes_allocated);
if (out_of_space) {
return AbortNode("Disk space is too low!", _("Disk space is too low!"));
}
Expand Down
38 changes: 0 additions & 38 deletions src/rpc/mining.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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<int64_t>();

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)
{
Expand Down
3 changes: 3 additions & 0 deletions src/validation.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
7 changes: 2 additions & 5 deletions src/wallet/staking.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand All @@ -159,7 +157,6 @@ void AvailableCoinsForStaking(const CWallet& wallet,

std::unique_ptr<SigningProvider> 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));

Expand Down Expand Up @@ -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;
Expand All @@ -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;
Expand Down

0 comments on commit e1880cf

Please sign in to comment.