Skip to content

Commit 6b5b70f

Browse files
PastaPastaPastaUdjinM6
authored andcommitted
Remove liquidity provider privatesend (#3082)
* remove liquidity provider. The reason behind this is two fold: 1. it is very likely nobody is currently running this on the mainnet (due to already strong liquidity), it provides no use for testnet as there you can just enable mixing and get the same affect. Because of this reason I don't find it okay to just remove it outright. 2. even if people did use it (or if some do as a novelty) it likely hurts the privacy of the system. This is because as a liquidity provider your outputs will always take many (sometimes hundreds) blocks before being used in a new mixing round, whereas real user's funds will normally be mixed again very rapidly. Signed-off-by: Pasta <pasta@dashboost.org> * remove unused function Signed-off-by: Pasta <pasta@dashboost.org>
1 parent 0b2221e commit 6b5b70f

File tree

4 files changed

+7
-53
lines changed

4 files changed

+7
-53
lines changed

src/init.cpp

Lines changed: 4 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -608,8 +608,6 @@ std::string HelpMessage(HelpMessageMode mode)
608608
strUsage += HelpMessageOpt("-privatesendrounds=<n>", strprintf(_("Use N separate masternodes for each denominated input to mix funds (%u-%u, default: %u)"), MIN_PRIVATESEND_ROUNDS, MAX_PRIVATESEND_ROUNDS, DEFAULT_PRIVATESEND_ROUNDS));
609609
strUsage += HelpMessageOpt("-privatesendamount=<n>", strprintf(_("Keep N DASH anonymized (%u-%u, default: %u)"), MIN_PRIVATESEND_AMOUNT, MAX_PRIVATESEND_AMOUNT, DEFAULT_PRIVATESEND_AMOUNT));
610610
strUsage += HelpMessageOpt("-privatesenddenoms=<n>", strprintf(_("Create up to N inputs of each denominated amount (%u-%u, default: %u)"), MIN_PRIVATESEND_DENOMS, MAX_PRIVATESEND_DENOMS, DEFAULT_PRIVATESEND_DENOMS));
611-
strUsage += HelpMessageOpt("-liquidityprovider=<n>", strprintf(_("Provide liquidity to PrivateSend by infrequently mixing coins on a continual basis (%u-%u, default: %u, 1=very frequent, high fees, %u=very infrequent, low fees)"),
612-
MIN_PRIVATESEND_LIQUIDITY, MAX_PRIVATESEND_LIQUIDITY, DEFAULT_PRIVATESEND_LIQUIDITY, MAX_PRIVATESEND_LIQUIDITY));
613611
#endif // ENABLE_WALLET
614612

615613
strUsage += HelpMessageGroup(_("InstantSend options:"));
@@ -968,24 +966,6 @@ void InitParameterInteraction()
968966
}
969967

970968
#ifdef ENABLE_WALLET
971-
int nLiqProvTmp = gArgs.GetArg("-liquidityprovider", DEFAULT_PRIVATESEND_LIQUIDITY);
972-
if (nLiqProvTmp > 0) {
973-
gArgs.ForceSetArg("-enableprivatesend", "1");
974-
LogPrintf("%s: parameter interaction: -liquidityprovider=%d -> setting -enableprivatesend=1\n", __func__, nLiqProvTmp);
975-
gArgs.ForceSetArg("-privatesendautostart", "1");
976-
LogPrintf("%s: parameter interaction: -liquidityprovider=%d -> setting -privatesendautostart=1\n", __func__, nLiqProvTmp);
977-
gArgs.ForceSetArg("-privatesendsessions", itostr(MIN_PRIVATESEND_SESSIONS));
978-
LogPrintf("%s: parameter interaction: -liquidityprovider=%d -> setting -privatesendsessions=%d\n", __func__, nLiqProvTmp, itostr(std::numeric_limits<int>::max()));
979-
gArgs.ForceSetArg("-privatesendrounds", itostr(std::numeric_limits<int>::max()));
980-
LogPrintf("%s: parameter interaction: -liquidityprovider=%d -> setting -privatesendrounds=%d\n", __func__, nLiqProvTmp, itostr(std::numeric_limits<int>::max()));
981-
gArgs.ForceSetArg("-privatesendamount", itostr(MAX_PRIVATESEND_AMOUNT));
982-
LogPrintf("%s: parameter interaction: -liquidityprovider=%d -> setting -privatesendamount=%d\n", __func__, nLiqProvTmp, MAX_PRIVATESEND_AMOUNT);
983-
gArgs.ForceSetArg("-privatesenddenoms", itostr(MAX_PRIVATESEND_DENOMS));
984-
LogPrintf("%s: parameter interaction: -liquidityprovider=%d -> setting -privatesenddenoms=%d\n", __func__, nLiqProvTmp, itostr(MAX_PRIVATESEND_DENOMS));
985-
gArgs.ForceSetArg("-privatesendmultisession", "0");
986-
LogPrintf("%s: parameter interaction: -liquidityprovider=%d -> setting -privatesendmultisession=0\n", __func__, nLiqProvTmp);
987-
}
988-
989969
if (gArgs.IsArgSet("-hdseed") && IsHex(gArgs.GetArg("-hdseed", "not hex")) && (gArgs.IsArgSet("-mnemonic") || gArgs.IsArgSet("-mnemonicpassphrase"))) {
990970
gArgs.ForceRemoveArg("-mnemonic");
991971
gArgs.ForceRemoveArg("-mnemonicpassphrase");
@@ -1960,13 +1940,7 @@ bool AppInitMain(boost::thread_group& threadGroup, CScheduler& scheduler)
19601940
// ********************************************************* Step 10b: setup PrivateSend
19611941

19621942
#ifdef ENABLE_WALLET
1963-
privateSendClient.nLiquidityProvider = std::min(std::max((int)gArgs.GetArg("-liquidityprovider", DEFAULT_PRIVATESEND_LIQUIDITY), MIN_PRIVATESEND_LIQUIDITY), MAX_PRIVATESEND_LIQUIDITY);
19641943
int nMaxRounds = MAX_PRIVATESEND_ROUNDS;
1965-
if(privateSendClient.nLiquidityProvider) {
1966-
// special case for liquidity providers only, normal clients should use default value
1967-
privateSendClient.SetMinBlocksToWait(privateSendClient.nLiquidityProvider * 15);
1968-
nMaxRounds = std::numeric_limits<int>::max();
1969-
}
19701944

19711945
if (vpwallets.empty()) {
19721946
privateSendClient.fEnablePrivateSend = privateSendClient.fPrivateSendRunning = false;
@@ -1981,12 +1955,11 @@ bool AppInitMain(boost::thread_group& threadGroup, CScheduler& scheduler)
19811955
privateSendClient.nPrivateSendDenoms = std::min(std::max((int)gArgs.GetArg("-privatesenddenoms", DEFAULT_PRIVATESEND_DENOMS), MIN_PRIVATESEND_DENOMS), MAX_PRIVATESEND_DENOMS);
19821956

19831957
if (privateSendClient.fEnablePrivateSend) {
1984-
LogPrintf("PrivateSend: liquidityprovider=%d, autostart=%d, multisession=%d, "
1958+
LogPrintf("PrivateSend: autostart=%d, multisession=%d, "
19851959
"sessions=%d, rounds=%d, amount=%d, denoms=%d\n",
1986-
privateSendClient.nLiquidityProvider, privateSendClient.fPrivateSendRunning,
1987-
privateSendClient.fPrivateSendMultiSession, privateSendClient.nPrivateSendSessions,
1988-
privateSendClient.nPrivateSendRounds, privateSendClient.nPrivateSendAmount,
1989-
privateSendClient.nPrivateSendDenoms);
1960+
privateSendClient.fPrivateSendRunning, privateSendClient.fPrivateSendMultiSession,
1961+
privateSendClient.nPrivateSendSessions, privateSendClient.nPrivateSendRounds,
1962+
privateSendClient.nPrivateSendAmount, privateSendClient.nPrivateSendDenoms);
19901963
}
19911964
#endif // ENABLE_WALLET
19921965

src/privatesend/privatesend-client.cpp

Lines changed: 3 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -928,14 +928,11 @@ bool CPrivateSendClientSession::DoAutomaticDenominating(CConnman& connman, bool
928928
} // LOCK2(cs_main, vpwallets[0]->cs_wallet);
929929

930930
bool fUseQueue = GetRandInt(100) > 33;
931-
// don't use the queues all of the time for mixing unless we are a liquidity provider
932-
if ((privateSendClient.nLiquidityProvider || fUseQueue) && JoinExistingQueue(nBalanceNeedsAnonymized, connman)) {
931+
// don't use the queues all of the time for mixing
932+
if (fUseQueue && JoinExistingQueue(nBalanceNeedsAnonymized, connman)) {
933933
return true;
934934
}
935935

936-
// do not initiate queue if we are a liquidity provider to avoid useless inter-mixing
937-
if (privateSendClient.nLiquidityProvider) return false;
938-
939936
if (StartNewQueue(nBalanceNeedsAnonymized, connman)) return true;
940937

941938
strAutoDenomResult = _("No compatible Masternode found.");
@@ -1225,15 +1222,10 @@ bool CPrivateSendClientSession::SubmitDenominate(CConnman& connman)
12251222
}
12261223

12271224
std::vector<std::pair<int, size_t> > vecInputsByRounds;
1228-
// Note: liquidity providers are fine with whatever number of inputs they've got
1229-
bool fDryRun = privateSendClient.nLiquidityProvider == 0;
12301225

12311226
for (int i = 0; i < privateSendClient.nPrivateSendRounds; i++) {
1232-
if (PrepareDenominate(i, i, strError, vecPSInOutPairs, vecPSInOutPairsTmp, fDryRun)) {
1227+
if (PrepareDenominate(i, i, strError, vecPSInOutPairs, vecPSInOutPairsTmp, true)) {
12331228
LogPrint(BCLog::PRIVATESEND, "CPrivateSendClientSession::SubmitDenominate -- Running PrivateSend denominate for %d rounds, success\n", i);
1234-
if (!fDryRun) {
1235-
return SendDenominate(vecPSInOutPairsTmp, connman);
1236-
}
12371229
vecInputsByRounds.emplace_back(i, vecPSInOutPairsTmp.size());
12381230
} else {
12391231
LogPrint(BCLog::PRIVATESEND, "CPrivateSendClientSession::SubmitDenominate -- Running PrivateSend denominate for %d rounds, error: %s\n", i, strError);

src/privatesend/privatesend-client.h

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -20,17 +20,14 @@ static const int MIN_PRIVATESEND_SESSIONS = 1;
2020
static const int MIN_PRIVATESEND_ROUNDS = 2;
2121
static const int MIN_PRIVATESEND_AMOUNT = 2;
2222
static const int MIN_PRIVATESEND_DENOMS = 10;
23-
static const int MIN_PRIVATESEND_LIQUIDITY = 0;
2423
static const int MAX_PRIVATESEND_SESSIONS = 10;
2524
static const int MAX_PRIVATESEND_ROUNDS = 16;
2625
static const int MAX_PRIVATESEND_DENOMS = 100000;
2726
static const int MAX_PRIVATESEND_AMOUNT = MAX_MONEY / COIN;
28-
static const int MAX_PRIVATESEND_LIQUIDITY = 100;
2927
static const int DEFAULT_PRIVATESEND_SESSIONS = 4;
3028
static const int DEFAULT_PRIVATESEND_ROUNDS = 4;
3129
static const int DEFAULT_PRIVATESEND_AMOUNT = 1000;
3230
static const int DEFAULT_PRIVATESEND_DENOMS = 300;
33-
static const int DEFAULT_PRIVATESEND_LIQUIDITY = 0;
3431

3532
static const bool DEFAULT_PRIVATESEND_AUTOSTART = false;
3633
static const bool DEFAULT_PRIVATESEND_MULTISESSION = false;
@@ -198,7 +195,6 @@ class CPrivateSendClientManager : public CPrivateSendBaseManager
198195
int nPrivateSendRounds;
199196
int nPrivateSendAmount;
200197
int nPrivateSendDenoms;
201-
int nLiquidityProvider;
202198
bool fEnablePrivateSend;
203199
bool fPrivateSendRunning;
204200
bool fPrivateSendMultiSession;
@@ -217,7 +213,6 @@ class CPrivateSendClientManager : public CPrivateSendBaseManager
217213
nPrivateSendRounds(DEFAULT_PRIVATESEND_ROUNDS),
218214
nPrivateSendAmount(DEFAULT_PRIVATESEND_AMOUNT),
219215
nPrivateSendDenoms(DEFAULT_PRIVATESEND_DENOMS),
220-
nLiquidityProvider(DEFAULT_PRIVATESEND_LIQUIDITY),
221216
fEnablePrivateSend(false),
222217
fPrivateSendRunning(false),
223218
fPrivateSendMultiSession(DEFAULT_PRIVATESEND_MULTISESSION),
@@ -232,8 +227,6 @@ class CPrivateSendClientManager : public CPrivateSendBaseManager
232227
void AddSkippedDenom(const CAmount& nDenomValue);
233228
void RemoveSkippedDenom(const CAmount& nDenomValue);
234229

235-
void SetMinBlocksToWait(int nMinBlocksToWaitIn) { nMinBlocksToWait = nMinBlocksToWaitIn; }
236-
237230
void ResetPool();
238231

239232
std::string GetStatuses();

src/qt/dashstrings.cpp

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -194,10 +194,6 @@ QT_TRANSLATE_NOOP("dash-core", ""
194194
"PrivateSend uses exact denominated amounts to send funds, you might simply "
195195
"need to anonymize some more coins."),
196196
QT_TRANSLATE_NOOP("dash-core", ""
197-
"Provide liquidity to PrivateSend by infrequently mixing coins on a continual "
198-
"basis (%u-%u, default: %u, 1=very frequent, high fees, %u=very infrequent, "
199-
"low fees)"),
200-
QT_TRANSLATE_NOOP("dash-core", ""
201197
"Prune configured below the minimum of %d MiB. Please use a higher number."),
202198
QT_TRANSLATE_NOOP("dash-core", ""
203199
"Prune: last wallet synchronisation goes beyond pruned data. You need to -"

0 commit comments

Comments
 (0)