aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorselsta <selsta@sent.at>2019-04-29 15:14:09 +0200
committerselsta <selsta@sent.at>2019-04-30 22:45:11 +0200
commit83e434395b911678bf91d2fb22be8dac5a4885fd (patch)
tree8fe6e8f005e48165eb5459a83a3f8857cf2abbb6
parentde257c0ab20405fa58a6128c5a7aa31add4185ec (diff)
downloadmonzero-gui-83e434395b911678bf91d2fb22be8dac5a4885fd.tar.gz
monzero-gui-83e434395b911678bf91d2fb22be8dac5a4885fd.tar.xz
monzero-gui-83e434395b911678bf91d2fb22be8dac5a4885fd.zip
Transfer: warn when sending to a known long PID service
-rw-r--r--pages/Transfer.qml21
1 files changed, 19 insertions, 2 deletions
diff --git a/pages/Transfer.qml b/pages/Transfer.qml
index 9d83f98e..7ecc0479 100644
--- a/pages/Transfer.qml
+++ b/pages/Transfer.qml
@@ -52,6 +52,9 @@ Rectangle {
property string sendButtonWarning: ""
property string startLinkText: qsTr("<style type='text/css'>a {text-decoration: none; color: #FF6C3C; font-size: 14px;}</style><font size='2'> (</font><a href='#'>Start daemon</a><font size='2'>)</font>") + translationManager.emptyString
property bool showAdvanced: false
+ // @TODO: remove after pid removal hardfork
+ property bool warningLongPidTransfer: false
+ property bool warningLongPidDescription: false
Clipboard { id: clipboard }
@@ -82,6 +85,17 @@ Rectangle {
paymentIdCheckbox.checked = paymentIdLine.text != "";
}
+ function isLongPidService(text) {
+ // @TODO: remove after pid removal hardfork
+ return text.length == 95 &&
+ [ "44tLjmXrQNrWJ5NBsEj2R77ZBEgDa3fEe9GLpSf2FRmhexPvfYDUAB7EXX1Hdb3aMQ9FLqdJ56yaAhiXoRsceGJCRS3Jxkn", // Binance
+ "4AQ3ZREb53FMYKBmpPn7BD7hphPk6G1ceinQX6gefAvhFJsNbeFsGwebZWCNxoJAbZhD9cjetBAqmLhfXmcNLBpPMsBL6yM", // KuCoin
+ "47YzEcMrU2S42UitURo7ukUDaSaL485Z1QbmFgq1vSs5g3JesL4rChwWf2uWk1va99JAaRxt65jhX9uAqQnjeFM44ckgZtp", // AnycoinDirect
+ "4BCeEPhodgPMbPWFN1dPwhWXdRX8q4mhhdZdA1dtSMLTLCEYvAj9QXjXAfF7CugEbmfBhgkqHbdgK9b2wKA6nqRZQCgvCDm", // Bitfinex
+ "463tWEBn5XZJSxLU6uLQnQ2iY9xuNcDbjLSjkn3XAXHCbLrTTErJrBWYgHJQyrCwkNgYvyV3z8zctJLPCZy24jvb3NiTcTJ" // Bittrex
+ ].indexOf(text) > -1
+ }
+
function clearFields() {
addressLine.text = ""
setPaymentId("");
@@ -243,7 +257,10 @@ Rectangle {
addressLine.text = clipboardText;
}
}
-
+ onTextChanged: {
+ // @TODO: remove after pid removal hardfork
+ warningLongPidTransfer = !persistentSettings.showPid && isLongPidService(text)
+ }
inlineButton.text: FontAwesome.qrcode
inlineButton.fontPixelSize: 22
inlineButton.fontFamily: FontAwesome.fontFamily
@@ -367,7 +384,7 @@ Rectangle {
// @TODO: remove after pid removal hardfork
id: paymentIdWarningBox
text: qsTr("You can enable transfers with payment ID on the settings page.") + translationManager.emptyString;
- visible: false
+ visible: !persistentSettings.showPid && (warningLongPidTransfer || warningLongPidDescription)
}
MoneroComponents.WarningBox {