forked from Public/monero-gui
Transfer: validate destination address
including preventing two payment ids (standalone and from integrated address)
This commit is contained in:
@@ -239,6 +239,19 @@ Rectangle {
|
||||
anchors.topMargin: 5
|
||||
}
|
||||
|
||||
function checkAddressAndPaymentID(address, payment_id, testnet) {
|
||||
print ("testing")
|
||||
if (!walletManager.addressValid(address, testnet))
|
||||
return false
|
||||
print ("address is valid")
|
||||
var ipid = walletManager.paymentIdFromAddress(address, testnet)
|
||||
print ("ipid: [" + ipid + "]")
|
||||
if (ipid.length > 0)
|
||||
return payment_id === ""
|
||||
print ("payment_id: [" + payment_id + "]")
|
||||
return payment_id === "" || walletManager.paymentIdValid(payment_id)
|
||||
}
|
||||
|
||||
StandardButton {
|
||||
id: sendButton
|
||||
anchors.left: parent.left
|
||||
@@ -251,7 +264,7 @@ Rectangle {
|
||||
shadowPressedColor: "#B32D00"
|
||||
releasedColor: "#FF6C3C"
|
||||
pressedColor: "#FF4304"
|
||||
enabled : addressLine.text.length > 0 && amountLine.text.length > 0 && (paymentIdLine.text.trim() === "" || walletManager.paymentIdValid(paymentIdLine.text.trim()))
|
||||
enabled : amountLine.text.length > 0 && checkAddressAndPaymentID(addressLine.text.trim(), paymentIdLine.text.trim(), appWindow.persistentSettings.testnet)
|
||||
onClicked: {
|
||||
console.log("Transfer: paymentClicked")
|
||||
var priority = priorityModel.get(priorityDropdown.currentIndex).priority
|
||||
|
||||
Reference in New Issue
Block a user