Add popup and info about using dedicated wallets when changing Bisq data dir

This commit is contained in:
chimp1984 2022-05-26 23:31:30 +02:00
parent 7fe93d9be7
commit d2557181d0
No known key found for this signature in database
GPG key ID: 9801B4EC591F90E3
2 changed files with 31 additions and 2 deletions

View file

@ -1534,7 +1534,10 @@ setting.info.msg=When selling BTC for XMR you can use the auto-confirm feature t
You can also set the maximum amount of BTC per trade to auto-confirm as well as the number of required \
confirmations here in Settings.\n\n\
See more details (including how to set up your own explorer node) on the Bisq wiki \
[HYPERLINK:https://bisq.wiki/Trading_Monero#Auto-confirming_trades]
[HYPERLINK:https://bisq.wiki/Trading_Monero#Auto-confirming_trades]\n\n\
Please be aware that when changing the Bisq data directory you must change the Monero wallet and address to avoid \
vulnerabilities related to transaction key re-use. More details can be found here: [HYPERLINK:https://github.com/monero-project/research-lab/issues/103].
####################################################################
# Account
####################################################################
@ -1642,7 +1645,15 @@ See the wiki for details on where to find this information on popular Monero wal
Failure to provide the required transaction data will result in losing disputes.\n\n\
Also note that Bisq now offers automatic confirming for XMR transactions to make trades quicker, \
but you need to enable it in Settings.\n\n\
See the wiki for more information about the auto-confirm feature: [HYPERLINK:https://bisq.wiki/Trading_Monero#Auto-confirming_trades].
See the wiki for more information about the auto-confirm feature: [HYPERLINK:https://bisq.wiki/Trading_Monero#Auto-confirming_trades].\n\n\
Please be aware that when changing the Bisq data directory you must change the Monero wallet and address to avoid \
vulnerabilities related to transaction key re-use. More details can be found here: [HYPERLINK:https://github.com/monero-project/research-lab/issues/103].
account.altcoin.popup.xmr.dataDirWarning=Please be aware that when changing the Bisq data directory you must change the Monero wallet and address to avoid \
vulnerabilities related to transaction key re-use. More details can be found here: [HYPERLINK:https://github.com/monero-project/research-lab/issues/103].
# suppress inspection "UnusedProperty"
account.altcoin.popup.msr.msg=Trading MSR on Bisq requires that you understand and fulfill \
the following requirements:\n\n\

View file

@ -534,11 +534,13 @@ public class MainViewModel implements ViewModel, BisqSetup.BisqSetupListener {
if (p2PService.isBootstrapped()) {
setupInvalidOpenOffersHandler();
maybeShowXmrTxKeyReUseWarning();
} else {
p2PService.addP2PServiceListener(new BootstrapListener() {
@Override
public void onUpdatedDataReceived() {
setupInvalidOpenOffersHandler();
maybeShowXmrTxKeyReUseWarning();
}
});
}
@ -566,6 +568,22 @@ public class MainViewModel implements ViewModel, BisqSetup.BisqSetupListener {
}
}
private void maybeShowXmrTxKeyReUseWarning() {
String key = "xmrTxKeyReUse";
// If we do not have a XMR account we set showAgain to true to avoid the popup at next restart because we show
// the information at account creation as well.
if (user.getPaymentAccounts() != null &&
user.getPaymentAccounts().stream()
.noneMatch(a -> a.getSingleTradeCurrency() != null && a.getSingleTradeCurrency().getCode().equals("XMR"))) {
preferences.dontShowAgain(key, true);
}
if (preferences.showAgain(key)) {
new Popup().information(Res.get("account.altcoin.popup.xmr.dataDirWarning")).dontShowAgainId(key).show();
}
}
private void setupP2PNumPeersWatcher() {
p2PService.getNumConnectedPeers().addListener((observable, oldValue, newValue) -> {
int numPeers = (int) newValue;