Partially revert 1922 (#2108)

Turned out we actually need mixing collaterals charged as fees in our mempool for them to be relayed.
This commit is contained in:
UdjinM6 2018-06-11 13:14:41 +03:00 committed by GitHub
parent 8c2d16f5f3
commit 8e129877a6
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -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]);
}
}
}
@ -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);
}
}
}