Mod:fix bug,when decode base64 string failed,return false
@@ -847,6 +847,7 @@ public class AccountServiceImpl implements AccountService {
public Result<Boolean> verifyMessageSignature(String address, String message, String signatureBase64) throws SignatureException {
boolean result = false;
message = AccountConstant.SIGN_MESSAGE_SALT + message;
+ try {
ECKey recoveryECKey = ECKey.signedMessageToKey(message, signatureBase64);
String recoveryAddress = AddressTool.getStringAddressByBytes(AddressTool.getAddress(recoveryECKey.getPubKey()));
if (recoveryAddress != null && recoveryAddress.equals(address)) {
@@ -854,7 +855,11 @@ public class AccountServiceImpl implements AccountService {
} else {
Log.info("verifyMessageSignature failed,address:{},message:{},signatureBase64:{}",address,message,signatureBase64);
}
+ } catch (SignatureException e) {
+ Log.info("",e);
+ }
return Result.getSuccess().setData(result);
+
}
}
