From faa81f2273c3411fb0eadaecbcab50eb190f5138 Mon Sep 17 00:00:00 2001 From: Craig Raw Date: Fri, 13 Sep 2024 09:49:24 +0200 Subject: [PATCH] replace message after comparison check with that provided in signed file --- .../com/sparrowwallet/sparrow/control/MessageSignDialog.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/main/java/com/sparrowwallet/sparrow/control/MessageSignDialog.java b/src/main/java/com/sparrowwallet/sparrow/control/MessageSignDialog.java index 4c6f25a5..a2a450bd 100644 --- a/src/main/java/com/sparrowwallet/sparrow/control/MessageSignDialog.java +++ b/src/main/java/com/sparrowwallet/sparrow/control/MessageSignDialog.java @@ -553,7 +553,7 @@ public class MessageSignDialog extends Dialog { String signedAddress = matcher.group(2); String signedSignature = matcher.group(3); - if(!signedMessage.trim().equals(message.getText().trim().replaceAll("\r*\n*", ""))) { + if(!message.getText().isEmpty() && !signedMessage.trim().equals(message.getText().trim().replaceAll("\r*\n*", ""))) { AppServices.showErrorDialog("Incorrect Message", "The file contained a different message of:\n\n" + signedMessage); return; } else if(!signedAddress.trim().equals(address.getText().trim())) { @@ -561,6 +561,7 @@ public class MessageSignDialog extends Dialog { return; } + message.setText(signedMessage); signature.setText(signedSignature); } else { signature.setText(content);