Fix testnet path when deleting wallet on node (#2395)

This commit is contained in:
Manolis Mandrapilias 2023-11-14 14:16:53 +01:00 committed by GitHub
parent 3301accc5b
commit b85cf745f8
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -668,10 +668,12 @@ class Node(AbstractNode):
)
except RpcError:
pass
if self.chain != "main":
path = os.path.join(datadir, f"{self.chain}/wallets", wallet_rpc_path)
else:
if self.chain == "test":
path = os.path.join(datadir, "testnet3/wallets", wallet_rpc_path)
elif self.chain == "main":
path = os.path.join(datadir, wallet_rpc_path)
else:
path = os.path.join(datadir, f"{self.chain}/wallets", wallet_rpc_path)
try:
shutil.rmtree(path, ignore_errors=False)
logger.debug(f"Removing wallet file at: {path}")