mirror of
https://github.com/Chia-Network/chia-blockchain.git
synced 2024-09-21 08:31:52 +03:00
migration (#9948)
This commit is contained in:
parent
a501c53228
commit
b08c904ebf
@ -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()
|
||||
|
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user