This commit is contained in:
Yostra 2022-01-27 02:19:42 +01:00 committed by GitHub
parent a501c53228
commit b08c904ebf
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 7 additions and 0 deletions

View File

@ -2,5 +2,6 @@ import os
from pathlib import Path
DEFAULT_ROOT_PATH = Path(os.path.expanduser(os.getenv("CHIA_ROOT", "~/.chia/mainnet"))).resolve()
STANDALONE_ROOT_PATH = Path(os.path.expanduser(os.getenv("CHIA_ROOT", "~/.chia/standalone_wallet"))).resolve()
DEFAULT_KEYS_ROOT_PATH = Path(os.path.expanduser(os.getenv("CHIA_KEYS_ROOT", "~/.chia_keys"))).resolve()

View File

@ -56,6 +56,7 @@ from chia.types.peer_info import PeerInfo
from chia.types.weight_proof import WeightProof, SubEpochData
from chia.util.byte_types import hexstr_to_bytes
from chia.util.config import WALLET_PEERS_PATH_KEY_DEPRECATED
from chia.util.default_root import STANDALONE_ROOT_PATH
from chia.util.ints import uint32, uint64
from chia.util.keychain import KeyringIsLocked, Keychain
from chia.util.network import get_host_addr
@ -189,6 +190,11 @@ class WalletNode:
.replace("KEY", db_path_key_suffix)
)
path = path_from_root(self.root_path, f"{db_path_replaced}_new")
standalone_path = path_from_root(STANDALONE_ROOT_PATH, f"{db_path_replaced}_new")
if not path.exists():
if standalone_path.exists():
path.write_bytes(standalone_path.read_bytes())
mkdir(path.parent)
self.new_peak_lock = asyncio.Lock()
assert self.server is not None