Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 19 additions & 2 deletions src/privatesend-server.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -448,7 +448,15 @@ void CPrivateSendServer::ChargeFees(CConnman& connman)
LogPrintf("CPrivateSendServer::ChargeFees -- found uncooperative node (didn't %s transaction), charging fees: %s\n",
(nState == POOL_STATE_SIGNING) ? "sign" : "send", vecOffendersCollaterals[0]->ToString());

connman.RelayTransaction(*vecOffendersCollaterals[0]);
LOCK(cs_main);

CValidationState state;
if(!AcceptToMemoryPool(mempool, state, vecOffendersCollaterals[0], false, NULL, NULL, false, maxTxFee)) {
// should never really happen
LogPrintf("CPrivateSendServer::ChargeFees -- ERROR: AcceptToMemoryPool failed!\n");
} else {
connman.RelayTransaction(*vecOffendersCollaterals[0]);
}
}
}

Expand All @@ -468,10 +476,19 @@ void CPrivateSendServer::ChargeRandomFees(CConnman& connman)
{
if(!fMasternodeMode) return;

LOCK(cs_main);

for (const auto& txCollateral : vecSessionCollaterals) {
if(GetRandInt(100) > 10) return;
LogPrintf("CPrivateSendServer::ChargeRandomFees -- charging random fees, txCollateral=%s", txCollateral->ToString());
connman.RelayTransaction(*txCollateral);

CValidationState state;
if(!AcceptToMemoryPool(mempool, state, txCollateral, false, NULL, NULL, false, maxTxFee)) {
// should never really happen
LogPrintf("CPrivateSendServer::ChargeRandomFees -- ERROR: AcceptToMemoryPool failed!\n");
} else {
connman.RelayTransaction(*txCollateral);
}
}
}

Expand Down