Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

refactor: PrivateSend -> CoinJoin + Move the tab #4038

Merged
merged 24 commits into from
Mar 17, 2021
Merged
Show file tree
Hide file tree
Changes from 3 commits
Commits
Show all changes
24 commits
Select commit Hold shift + click to select a range
0b4fecd
qt|wallet|privatesend: Rename PrivateSend to CoinJoin in GUI strings
xdustinface Mar 10, 2021
d7265d1
qt: Move CoinJoin next to Transactions
xdustinface Mar 10, 2021
b2e9318
qt: Adjust status tip of privateSendCoinsMenuAction
xdustinface Mar 10, 2021
ee9bd98
rename: privateSend -> coinJoin
xdustinface Mar 11, 2021
379850b
rename: privatesend -> coinjoin
xdustinface Mar 11, 2021
d7dbdaa
rename: PrivateSend -> CoinJoin
xdustinface Mar 11, 2021
f876b9a
rename: use_ps -> use_cj
xdustinface Mar 11, 2021
b40e15d
rename: PRIVATESEND -> COINJOIN
xdustinface Mar 11, 2021
82d2f07
rename: privatesend -> coinjoin for files and folders
xdustinface Mar 11, 2021
b9c5252
refactor: Re-order coinjoin files in cmake/make files
xdustinface Mar 11, 2021
33daf46
refactor: Re-order coinjoin includes where it makes sense
xdustinface Mar 11, 2021
b6a82a0
test: Update lint-circular-dependencies.sh
xdustinface Mar 11, 2021
023b73b
Few cleanups
UdjinM6 Mar 11, 2021
9c1a3bd
test: test/coinjoin_tests.cpp -> wallet/test/coinjoin_test.cpp
xdustinface Mar 11, 2021
193ac1b
s/AdvancedPSUI/AdvancedCJUI/g
UdjinM6 Mar 11, 2021
7eb9e0d
s/privateSentAmountChanged/coinJoinAmountChanged/g
UdjinM6 Mar 11, 2021
5533556
wallet: Rename "ps_salt" backwards compatible
xdustinface Mar 11, 2021
41e0a7c
Minimal PrivateSend -> CoinJoin migration for settings and cmd-line
UdjinM6 Mar 11, 2021
e013f9c
wallet: Fix privatesendrounds -> coinjoinrounds migration
xdustinface Mar 11, 2021
74bcb8b
qt: Migrate nPrivateSendAmount -> nCoinJoinAmount
xdustinface Mar 11, 2021
578ec52
`-coinjoindenoms` never existed
UdjinM6 Mar 11, 2021
5fb1774
Migrate all PS options/settings
UdjinM6 Mar 11, 2021
68b5e63
rpc: Formatting only
xdustinface Mar 16, 2021
5b5de66
qt: Make Send/CoinJoin tabs a bit more distinguishable
xdustinface Mar 16, 2021
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
8 changes: 4 additions & 4 deletions src/privatesend/privatesend-client.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -315,7 +315,7 @@ std::string CPrivateSendClientSession::GetStatus(bool fWaitForBlock)

switch (nState) {
case POOL_STATE_IDLE:
return _("PrivateSend is idle.");
return _("CoinJoin is idle.");
case POOL_STATE_QUEUE:
if (nStatusMessageProgress % 70 <= 30)
strSuffix = ".";
Expand All @@ -337,7 +337,7 @@ std::string CPrivateSendClientSession::GetStatus(bool fWaitForBlock)
strSuffix = "...";
return strprintf(_("Found enough users, signing ( waiting %s )"), strSuffix);
case POOL_STATE_ERROR:
return _("PrivateSend request incomplete:") + " " + strLastMessage + " " + _("Will retry...");
return _("CoinJoin request incomplete:") + " " + strLastMessage + " " + _("Will retry...");
default:
return strprintf(_("Unknown state: id = %u"), nState);
}
Expand Down Expand Up @@ -982,7 +982,7 @@ bool CPrivateSendClientManager::DoAutomaticDenominating(CConnman& connman, bool

if (WaitForAnotherBlock()) {
LogPrint(BCLog::PRIVATESEND, "CPrivateSendClientManager::DoAutomaticDenominating -- Last successful PrivateSend action was too recent\n");
strAutoDenomResult = _("Last successful PrivateSend action was too recent.");
strAutoDenomResult = _("Last successful CoinJoin action was too recent.");
return false;
}

Expand Down Expand Up @@ -1297,7 +1297,7 @@ bool CPrivateSendClientSession::SelectDenominate(std::string& strErrorRet, std::
}

if (GetEntriesCount() > 0) {
strErrorRet = "Already have pending entries in the PrivateSend pool";
strErrorRet = "Already have pending entries in the CoinJoin pool";
return false;
}

Expand Down
2 changes: 1 addition & 1 deletion src/privatesend/privatesend.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -499,7 +499,7 @@ std::string CPrivateSend::GetMessageByID(PoolMessage nMessageID)
case ERR_QUEUE_FULL:
return _("Masternode queue is full.");
case ERR_RECENT:
return _("Last PrivateSend was too recent.");
return _("Last CoinJoin was too recent.");
case ERR_SESSION:
return _("Session not complete!");
case ERR_MISSING_TX:
Expand Down
20 changes: 10 additions & 10 deletions src/qt/bitcoingui.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -374,8 +374,8 @@ void BitcoinGUI::createActions()
sendCoinsMenuAction->setStatusTip(tr("Send coins to a Dash address"));
sendCoinsMenuAction->setToolTip(sendCoinsMenuAction->statusTip());

privateSendCoinsMenuAction = new QAction("&PrivateSend", this);
privateSendCoinsMenuAction->setStatusTip(tr("PrivateSend coins to a Dash address"));
privateSendCoinsMenuAction = new QAction("&CoinJoin", this);
privateSendCoinsMenuAction->setStatusTip(tr("Send CoinJoin funds to a Dash address"));
privateSendCoinsMenuAction->setToolTip(privateSendCoinsMenuAction->statusTip());

receiveCoinsMenuAction = new QAction(tr("&Receive"), this);
Expand Down Expand Up @@ -458,9 +458,9 @@ void BitcoinGUI::createActions()
showHelpMessageAction->setMenuRole(QAction::NoRole);
showHelpMessageAction->setStatusTip(tr("Show the %1 help message to get a list with possible Dash command-line options").arg(tr(PACKAGE_NAME)));

showPrivateSendHelpAction = new QAction(tr("&PrivateSend information"), this);
showPrivateSendHelpAction = new QAction(tr("&CoinJoin information"), this);
showPrivateSendHelpAction->setMenuRole(QAction::NoRole);
showPrivateSendHelpAction->setStatusTip(tr("Show the PrivateSend basic information"));
showPrivateSendHelpAction->setStatusTip(tr("Show the CoinJoin basic information"));

connect(quitAction, SIGNAL(triggered()), qApp, SLOT(quit()));
connect(aboutAction, SIGNAL(triggered()), this, SLOT(aboutClicked()));
Expand Down Expand Up @@ -593,11 +593,6 @@ void BitcoinGUI::createToolBars()
sendCoinsButton->setStatusTip(sendCoinsMenuAction->statusTip());
tabGroup->addButton(sendCoinsButton);

privateSendCoinsButton = new QToolButton(this);
privateSendCoinsButton->setText(privateSendCoinsMenuAction->text());
privateSendCoinsButton->setStatusTip(privateSendCoinsMenuAction->statusTip());
tabGroup->addButton(privateSendCoinsButton);

receiveCoinsButton = new QToolButton(this);
receiveCoinsButton->setText(receiveCoinsMenuAction->text());
receiveCoinsButton->setStatusTip(receiveCoinsMenuAction->statusTip());
Expand All @@ -608,6 +603,11 @@ void BitcoinGUI::createToolBars()
historyButton->setStatusTip(tr("Browse transaction history"));
tabGroup->addButton(historyButton);

privateSendCoinsButton = new QToolButton(this);
privateSendCoinsButton->setText(privateSendCoinsMenuAction->text());
privateSendCoinsButton->setStatusTip(privateSendCoinsMenuAction->statusTip());
tabGroup->addButton(privateSendCoinsButton);

QSettings settings;
if (settings.value("fShowMasternodesTab").toBool()) {
masternodeButton = new QToolButton(this);
Expand Down Expand Up @@ -1152,7 +1152,7 @@ void BitcoinGUI::updatePrivateSendVisibility()
// Hiding the QToolButton itself doesn't work for the GUI part
// but is still needed for shortcuts to work properly.
if (appToolBar != nullptr) {
appToolBar->actions()[2]->setVisible(fEnabled);
appToolBar->actions()[4]->setVisible(fEnabled);
privateSendCoinsButton->setVisible(fEnabled);
GUIUtil::updateButtonGroupShortcuts(tabGroup);
}
Expand Down
4 changes: 2 additions & 2 deletions src/qt/coincontroldialog.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -668,11 +668,11 @@ void CoinControlDialog::updateView()
if (fHideAdditional) {
strHideButton = tr("Show all coins");
} else {
strHideButton = tr("Hide PrivateSend coins");
strHideButton = tr("Hide CoinJoin coins");
}
} else {
if (fHideAdditional) {
strHideButton = tr("Show all PrivateSend coins");
strHideButton = tr("Show all CoinJoin coins");
} else {
strHideButton = tr("Show spendable coins only");
}
Expand Down
28 changes: 14 additions & 14 deletions src/qt/forms/optionsdialog.ui
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@
<item>
<widget class="QPushButton" name="btnPrivateSend">
<property name="text">
<string>PrivateSend</string>
<string>CoinJoin</string>
</property>
<property name="checkable">
<bool>true</bool>
Expand Down Expand Up @@ -278,10 +278,10 @@
<item>
<widget class="QCheckBox" name="privateSendEnabled">
<property name="toolTip">
<string>Show mixing interface on Overview screen and reveal PrivateSend screen which allows to spend fully mixed coins only.&lt;br/&gt;A new tab with more settings will also appear in this dialog, please make sure to check them before mixing your coins.</string>
<string>Show mixing interface on Overview screen and reveal CoinJoin screen which allows to spend fully mixed coins only.&lt;br/&gt;A new tab with more settings will also appear in this dialog, please make sure to check them before mixing your coins.</string>
</property>
<property name="text">
<string>Enable PrivateSend features</string>
<string>Enable CoinJoin features</string>
</property>
</widget>
</item>
Expand All @@ -307,40 +307,40 @@
<item>
<widget class="QCheckBox" name="showAdvancedPSUI">
<property name="toolTip">
<string>Show additional information and buttons for PrivateSend on overview screen.</string>
<string>Show additional information and buttons for CoinJoin on overview screen.</string>
</property>
<property name="text">
<string>Enable advanced PrivateSend interface</string>
<string>Enable advanced CoinJoin interface</string>
</property>
</widget>
</item>
<item>
<widget class="QCheckBox" name="showPrivateSendPopups">
<property name="toolTip">
<string>Show system popups for PrivateSend mixing transactions&lt;br/&gt;just like for all other transaction types.</string>
<string>Show system popups for CoinJoin mixing transactions&lt;br/&gt;just like for all other transaction types.</string>
</property>
<property name="text">
<string>Show popups for PrivateSend transactions</string>
<string>Show popups for CoinJoin transactions</string>
</property>
</widget>
</item>
<item>
<widget class="QCheckBox" name="lowKeysWarning">
<property name="toolTip">
<string>Show warning dialog when PrivateSend detects that wallet has very low number of keys left.</string>
<string>Show warning dialog when CoinJoin detects that wallet has very low number of keys left.</string>
</property>
<property name="text">
<string>Warn if PrivateSend is running out of keys</string>
<string>Warn if CoinJoin is running out of keys</string>
</property>
</widget>
</item>
<item>
<widget class="QCheckBox" name="privateSendMultiSession">
<property name="toolTip">
<string>Whether to use experimental PrivateSend mode with multiple mixing sessions per block.&lt;br/&gt;Note: You must use this feature carefully.&lt;br/&gt;Make sure you always have recent wallet (auto)backup in a safe place!</string>
<string>Whether to use experimental CoinJoin mode with multiple mixing sessions per block.&lt;br/&gt;Note: You must use this feature carefully.&lt;br/&gt;Make sure you always have recent wallet (auto)backup in a safe place!</string>
</property>
<property name="text">
<string>Enable PrivateSend &amp;multi-session</string>
<string>Enable CoinJoin &amp;multi-session</string>
</property>
</widget>
</item>
Expand All @@ -352,7 +352,7 @@
<string>This setting determines the amount of individual masternodes that an input will be mixed through.&lt;br/&gt;More rounds of mixing gives a higher degree of privacy, but also costs more in fees.</string>
</property>
<property name="text">
<string>PrivateSend rounds to use</string>
<string>CoinJoin rounds to use</string>
</property>
</widget>
</item>
Expand All @@ -376,7 +376,7 @@
<item>
<widget class="QLabel" name="lblPrivateSendAmountText">
<property name="toolTip">
<string>This amount acts as a threshold to turn off PrivateSend once it's reached.</string>
<string>This amount acts as a threshold to turn off CoinJoin once it's reached.</string>
</property>
<property name="statusTip">
<string notr="true"/>
Expand All @@ -391,7 +391,7 @@
<string notr="true"/>
</property>
<property name="text">
<string>Target PrivateSend balance</string>
<string>Target CoinJoin balance</string>
</property>
</widget>
</item>
Expand Down
4 changes: 2 additions & 2 deletions src/qt/forms/overviewpage.ui
Original file line number Diff line number Diff line change
Expand Up @@ -368,7 +368,7 @@
<item>
<widget class="QLabel" name="labelPrivateSendHeader">
<property name="text">
<string>PrivateSend</string>
<string>CoinJoin</string>
</property>
</widget>
</item>
Expand Down Expand Up @@ -448,7 +448,7 @@
<item row="2" column="0">
<widget class="QLabel" name="labelAnonymizedText">
<property name="text">
<string>PrivateSend Balance:</string>
<string>CoinJoin Balance:</string>
</property>
</widget>
</item>
Expand Down
26 changes: 13 additions & 13 deletions src/qt/overviewpage.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -511,7 +511,7 @@ void OverviewPage::privateSendStatus(bool fForce)
}

setWidgetsVisible(false);
ui->togglePrivateSend->setText(tr("Start Mixing"));
ui->togglePrivateSend->setText(tr("Start CoinJoin"));

QString strEnabled = tr("Disabled");
// Show how many keys left in advanced PS UI mode only
Expand Down Expand Up @@ -539,7 +539,7 @@ void OverviewPage::privateSendStatus(bool fForce)
tr("Note: You can turn this message off in options.");
ui->labelPrivateSendEnabled->setToolTip(strWarn);
LogPrint(BCLog::PRIVATESEND, "OverviewPage::privateSendStatus -- Very low number of keys left since last automatic backup, warning user and trying to create new backup...\n");
QMessageBox::warning(this, "PrivateSend", strWarn, QMessageBox::Ok, QMessageBox::Ok);
QMessageBox::warning(this, "CoinJoin", strWarn, QMessageBox::Ok, QMessageBox::Ok);
} else {
LogPrint(BCLog::PRIVATESEND, "OverviewPage::privateSendStatus -- Very low number of keys left since last automatic backup, skipping warning and trying to create new backup...\n");
}
Expand All @@ -551,15 +551,15 @@ void OverviewPage::privateSendStatus(bool fForce)
// It's still more or less safe to continue but warn user anyway
LogPrint(BCLog::PRIVATESEND, "OverviewPage::privateSendStatus -- WARNING! Something went wrong on automatic backup: %s\n", strBackupWarning.toStdString());

QMessageBox::warning(this, "PrivateSend",
QMessageBox::warning(this, "CoinJoin",
tr("WARNING! Something went wrong on automatic backup") + ":<br><br>" + strBackupWarning,
QMessageBox::Ok, QMessageBox::Ok);
}
if (!strBackupError.isEmpty()) {
// Things are really broken, warn user and stop mixing immediately
LogPrint(BCLog::PRIVATESEND, "OverviewPage::privateSendStatus -- ERROR! Failed to create automatic backup: %s\n", strBackupError.toStdString());

QMessageBox::warning(this, "PrivateSend",
QMessageBox::warning(this, "CoinJoin",
tr("ERROR! Failed to create automatic backup") + ":<br><br>" + strBackupError + "<br>" +
tr("Mixing is disabled, please close your wallet and fix the issue!"),
QMessageBox::Ok, QMessageBox::Ok);
Expand Down Expand Up @@ -605,8 +605,8 @@ void OverviewPage::togglePrivateSend(){
// Popup some information on first mixing
QString hasMixed = settings.value("hasMixed").toString();
if(hasMixed.isEmpty()){
QMessageBox::information(this, "PrivateSend",
tr("If you don't want to see internal PrivateSend fees/transactions select \"Most Common\" as Type on the \"Transactions\" tab."),
QMessageBox::information(this, "CoinJoin",
tr("If you don't want to see internal CoinJoin fees/transactions select \"Most Common\" as Type on the \"Transactions\" tab."),
QMessageBox::Ok, QMessageBox::Ok);
settings.setValue("hasMixed", "hasMixed");
}
Expand All @@ -616,8 +616,8 @@ void OverviewPage::togglePrivateSend(){
const CAmount nMinAmount = options.getSmallestDenomination() + options.getMaxCollateralAmount();
if(m_balances.balance < nMinAmount) {
QString strMinAmount(BitcoinUnits::formatWithUnit(nDisplayUnit, nMinAmount));
QMessageBox::warning(this, "PrivateSend",
tr("PrivateSend requires at least %1 to use.").arg(strMinAmount),
QMessageBox::warning(this, "CoinJoin",
tr("CoinJoin requires at least %1 to use.").arg(strMinAmount),
QMessageBox::Ok, QMessageBox::Ok);
return;
}
Expand All @@ -630,10 +630,10 @@ void OverviewPage::togglePrivateSend(){
{
//unlock was cancelled
walletModel->privateSend().resetCachedBlocks();
QMessageBox::warning(this, "PrivateSend",
tr("Wallet is locked and user declined to unlock. Disabling PrivateSend."),
QMessageBox::warning(this, "CoinJoin",
tr("Wallet is locked and user declined to unlock. Disabling CoinJoin."),
QMessageBox::Ok, QMessageBox::Ok);
LogPrint(BCLog::PRIVATESEND, "OverviewPage::togglePrivateSend -- Wallet is locked and user declined to unlock. Disabling PrivateSend.\n");
LogPrint(BCLog::PRIVATESEND, "OverviewPage::togglePrivateSend -- Wallet is locked and user declined to unlock. Disabling CoinJoin.\n");
return;
}
}
Expand All @@ -643,11 +643,11 @@ void OverviewPage::togglePrivateSend(){
walletModel->privateSend().resetCachedBlocks();

if (walletModel->privateSend().isMixing()) {
ui->togglePrivateSend->setText(tr("Start Mixing"));
ui->togglePrivateSend->setText(tr("Start CoinJoin"));
walletModel->privateSend().resetPool();
walletModel->privateSend().stopMixing();
} else {
ui->togglePrivateSend->setText(tr("Stop Mixing"));
ui->togglePrivateSend->setText(tr("Stop CoinJoin"));
walletModel->privateSend().startMixing();
}
}
Expand Down
10 changes: 5 additions & 5 deletions src/qt/sendcoinsdialog.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -157,8 +157,8 @@ SendCoinsDialog::SendCoinsDialog(bool _fPrivateSend, QWidget* parent) :
minimizeFeeSection(settings.value("fFeeSectionMinimized").toBool());

if (_fPrivateSend) {
ui->sendButton->setText("PrivateS&end");
ui->sendButton->setToolTip(tr("Confirm the PrivateSend action"));
ui->sendButton->setText("Send");
ui->sendButton->setToolTip(tr("Confirm the send action"));
} else {
ui->sendButton->setText(tr("S&end"));
ui->sendButton->setToolTip(tr("Confirm the send action"));
Expand Down Expand Up @@ -377,7 +377,7 @@ void SendCoinsDialog::send(QList<SendCoinsRecipient> recipients)


if(m_coin_control->IsUsingPrivateSend()) {
questionString.append(tr("using") + " <b>" + tr("PrivateSend funds only") + "</b>");
questionString.append(tr("using") + " <b>" + tr("CoinJoin funds only") + "</b>");
} else {
questionString.append(tr("using") + " <b>" + tr("any available funds") + "</b>");
}
Expand All @@ -400,7 +400,7 @@ void SendCoinsDialog::send(QList<SendCoinsRecipient> recipients)
questionString.append(tr("are added as transaction fee"));

if (m_coin_control->IsUsingPrivateSend()) {
questionString.append(" " + tr("(PrivateSend transactions have higher fees usually due to no change output being allowed)"));
questionString.append(" " + tr("(CoinJoin transactions have higher fees usually due to no change output being allowed)"));
}
}

Expand All @@ -422,7 +422,7 @@ void SendCoinsDialog::send(QList<SendCoinsRecipient> recipients)
if (nInputs >= 10 && m_coin_control->IsUsingPrivateSend()) {
questionString.append("<br />");
questionString.append("<span style='" + GUIUtil::getThemedStyleQString(GUIUtil::ThemedStyle::TS_ERROR) + "'>");
questionString.append(tr("Warning: Using PrivateSend with %1 or more inputs can harm your privacy and is not recommended").arg(10));
questionString.append(tr("Warning: Using CoinJoin with %1 or more inputs can harm your privacy and is not recommended").arg(10));
questionString.append("</span> ");
}
}
Expand Down
12 changes: 6 additions & 6 deletions src/qt/transactiontablemodel.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -380,7 +380,7 @@ QString TransactionTableModel::formatTxType(const TransactionRecord *wtx) const
case TransactionRecord::RecvFromOther:
return tr("Received from");
case TransactionRecord::RecvWithPrivateSend:
return tr("Received via PrivateSend");
return tr("Received via CoinJoin");
case TransactionRecord::SendToAddress:
case TransactionRecord::SendToOther:
return tr("Sent to");
Expand All @@ -390,15 +390,15 @@ QString TransactionTableModel::formatTxType(const TransactionRecord *wtx) const
return tr("Mined");

case TransactionRecord::PrivateSendDenominate:
return tr("PrivateSend Denominate");
return tr("CoinJoin Denominate");
case TransactionRecord::PrivateSendCollateralPayment:
return tr("PrivateSend Collateral Payment");
return tr("CoinJoin Collateral Payment");
case TransactionRecord::PrivateSendMakeCollaterals:
return tr("PrivateSend Make Collateral Inputs");
return tr("CoinJoin Make Collateral Inputs");
case TransactionRecord::PrivateSendCreateDenominations:
return tr("PrivateSend Create Denominations");
return tr("CoinJoin Create Denominations");
case TransactionRecord::PrivateSend:
return "PrivateSend";
return "CoinJoin";

default:
return QString();
Expand Down
Loading