JSON-RPC method: prioritisetransaction <txid> <priority delta> <priority tx fee>
Accepts the transaction into mined blocks at a higher (or lower) priority
This commit is contained in:
@@ -447,6 +447,7 @@ void CTxMemPool::removeForBlock(const std::vector<CTransaction>& vtx, unsigned i
|
||||
std::list<CTransaction> dummy;
|
||||
remove(tx, dummy, false);
|
||||
removeConflicts(tx, conflicts);
|
||||
ClearPrioritisation(tx.GetHash());
|
||||
}
|
||||
}
|
||||
|
||||
@@ -564,6 +565,34 @@ CTxMemPool::ReadFeeEstimates(CAutoFile& filein)
|
||||
return true;
|
||||
}
|
||||
|
||||
void CTxMemPool::PrioritiseTransaction(const uint256 hash, const string strHash, double dPriorityDelta, int64_t nFeeDelta)
|
||||
{
|
||||
{
|
||||
LOCK(cs);
|
||||
std::pair<double, int64_t> &deltas = mapDeltas[hash];
|
||||
deltas.first += dPriorityDelta;
|
||||
deltas.second += nFeeDelta;
|
||||
}
|
||||
LogPrintf("PrioritiseTransaction: %s priority += %f, fee += %d\n", strHash.c_str(), dPriorityDelta, nFeeDelta);
|
||||
}
|
||||
|
||||
void CTxMemPool::ApplyDeltas(const uint256 hash, double &dPriorityDelta, int64_t &nFeeDelta)
|
||||
{
|
||||
LOCK(cs);
|
||||
std::map<uint256, std::pair<double, int64_t> >::iterator pos = mapDeltas.find(hash);
|
||||
if (pos == mapDeltas.end())
|
||||
return;
|
||||
const std::pair<double, int64_t> &deltas = pos->second;
|
||||
dPriorityDelta += deltas.first;
|
||||
nFeeDelta += deltas.second;
|
||||
}
|
||||
|
||||
void CTxMemPool::ClearPrioritisation(const uint256 hash)
|
||||
{
|
||||
LOCK(cs);
|
||||
mapDeltas.erase(hash);
|
||||
}
|
||||
|
||||
|
||||
CCoinsViewMemPool::CCoinsViewMemPool(CCoinsView &baseIn, CTxMemPool &mempoolIn) : CCoinsViewBacked(baseIn), mempool(mempoolIn) { }
|
||||
|
||||
|
||||
Reference in New Issue
Block a user