From 6b83927048c144d904d2f1301a608e0647e03825 Mon Sep 17 00:00:00 2001 From: proto <34919827+protoniuman@users.noreply.github.com> Date: Mon, 21 Feb 2022 16:17:17 +0100 Subject: [PATCH] Persist MintingAccounts.json on minting accounts add/remove this fix the behavior of the node, After adding or removing a minting account, allowing it to persist it to the backup folder --- src/main/java/org/qortal/api/resource/AdminResource.java | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/main/java/org/qortal/api/resource/AdminResource.java b/src/main/java/org/qortal/api/resource/AdminResource.java index bde4bed4..7f4a3806 100644 --- a/src/main/java/org/qortal/api/resource/AdminResource.java +++ b/src/main/java/org/qortal/api/resource/AdminResource.java @@ -315,6 +315,7 @@ public class AdminResource { repository.getAccountRepository().save(mintingAccountData); repository.saveChanges(); + repository.exportNodeLocalData();//after adding new minting account let's persist it to the backup MintingAccounts.json } catch (IllegalArgumentException e) { throw ApiExceptionFactory.INSTANCE.createException(request, ApiError.INVALID_PRIVATE_KEY, e); } catch (DataException e) { @@ -355,6 +356,7 @@ public class AdminResource { return "false"; repository.saveChanges(); + repository.exportNodeLocalData();//after removing new minting account let's persist it to the backup MintingAccounts.json } catch (IllegalArgumentException e) { throw ApiExceptionFactory.INSTANCE.createException(request, ApiError.INVALID_PRIVATE_KEY, e); } catch (DataException e) { @@ -546,7 +548,7 @@ public class AdminResource { @Path("/repository/data") @Operation( summary = "Export sensitive/node-local data from repository.", - description = "Exports data to .script files on local machine" + description = "Exports data to .json files on local machine" ) @ApiErrors({ApiError.INVALID_DATA, ApiError.REPOSITORY_ISSUE}) @SecurityRequirement(name = "apiKey")