From 4c49069bb8cf5b1fc9540a7283d8a0893f00d9e2 Mon Sep 17 00:00:00 2001 From: RyuMaster Date: Thu, 4 Aug 2022 22:28:25 +0300 Subject: [PATCH] Add createwallet method --- src/app/service/global.service.ts | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/src/app/service/global.service.ts b/src/app/service/global.service.ts index 92ff348..e4aae22 100644 --- a/src/app/service/global.service.ts +++ b/src/app/service/global.service.ts @@ -1160,12 +1160,14 @@ export class GlobalService implements OnDestroy { const path = window.require('path'); let basepath = window.require('electron').remote.app.getPath('appData'); let filenameCheck = path.join(basepath, './Xaya/'); + let filenameCheckWallets = path.join(basepath, './Xaya/wallets/'); if (!fs.existsSync(filenameCheck)) { - swal("Can not detect daemon folder. Please take screenshot and report to konstantin@xaya.io or forum.xaya.io; Ошибка обнаружения папки с даемоном, пожалуйста, вышлите скриншот на адрес konstantin@xaya или forum.xaya.io", "error", "error") + swal("Can not detect daemon folder. Please take screenshot and report to Discord", "error", "error") } + _that.clientMain = new Client({ network: 'mainnet', wallet: "vault.dat", host: host, password: pData[1], port: port, username: pData[0]}); _that.clientVault= new Client({ network: 'mainnet', wallet: "game.dat", host: host, password: pData[1], port: port, username: pData[0]}); @@ -1174,6 +1176,14 @@ export class GlobalService implements OnDestroy { { _that.getOverviewInfo(); _that.openChatApplication(pData[0], pData[1], port, host); + + // After Bitcoin Core update, we need to create wallets manually if missing + if (!fs.existsSync(filenameCheckWallets)) + { + this.client.createWallet("vault.dat"); + this.client.createWallet("game.dat"); + } + }, 5000);