Skip to content

Commit fa5fc41

Browse files
committed
Fix -liquidityprovider option (#1829)
revert to pre-1248 logic for liquidity providers
1 parent c9bafe1 commit fa5fc41

File tree

1 file changed

+17
-6
lines changed

1 file changed

+17
-6
lines changed

src/privatesend-client.cpp

Lines changed: 17 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1002,13 +1002,24 @@ bool CPrivateSendClient::SubmitDenominate(CConnman& connman)
10021002
std::vector<CTxOut> vecTxOutRet;
10031003

10041004
// Submit transaction to the pool if we get here
1005-
// Try to use only inputs with the same number of rounds starting from the highest number of rounds possible
1006-
for(int i = nPrivateSendRounds; i > 0; i--) {
1007-
if(PrepareDenominate(i - 1, i, strError, vecTxDSInRet, vecTxOutRet)) {
1008-
LogPrintf("CPrivateSendClient::SubmitDenominate -- Running PrivateSend denominate for %d rounds, success\n", i);
1009-
return SendDenominate(vecTxDSInRet, vecTxOutRet, connman);
1005+
if (nLiquidityProvider) {
1006+
// Try to use only inputs with the same number of rounds starting from the lowest number of rounds possible
1007+
for(int i = 0; i< nPrivateSendRounds; i++) {
1008+
if(PrepareDenominate(i, i + 1, strError, vecTxDSInRet, vecTxOutRet)) {
1009+
LogPrintf("CPrivateSendClient::SubmitDenominate -- Running PrivateSend denominate for %d rounds, success\n", i);
1010+
return SendDenominate(vecTxDSInRet, vecTxOutRet, connman);
1011+
}
1012+
LogPrint("privatesend", "CPrivateSendClient::SubmitDenominate -- Running PrivateSend denominate for %d rounds, error: %s\n", i, strError);
1013+
}
1014+
} else {
1015+
// Try to use only inputs with the same number of rounds starting from the highest number of rounds possible
1016+
for(int i = nPrivateSendRounds; i > 0; i--) {
1017+
if(PrepareDenominate(i - 1, i, strError, vecTxDSInRet, vecTxOutRet)) {
1018+
LogPrintf("CPrivateSendClient::SubmitDenominate -- Running PrivateSend denominate for %d rounds, success\n", i);
1019+
return SendDenominate(vecTxDSInRet, vecTxOutRet, connman);
1020+
}
1021+
LogPrint("privatesend", "CPrivateSendClient::SubmitDenominate -- Running PrivateSend denominate for %d rounds, error: %s\n", i, strError);
10101022
}
1011-
LogPrint("privatesend", "CPrivateSendClient::SubmitDenominate -- Running PrivateSend denominate for %d rounds, error: %s\n", i, strError);
10121023
}
10131024

10141025
// We failed? That's strange but let's just make final attempt and try to mix everything

0 commit comments

Comments
 (0)