mirror of
https://github.com/dashpay/dash.git
synced 2024-12-25 03:52:49 +01:00
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:
parent
8c2d16f5f3
commit
8e129877a6
@ -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);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user