Don't sync, save, or load null seed wallets. They only act as a placeholder wallet when redeeming/refunding a P2SH.

This commit is contained in:
CalDescent 2022-08-07 18:38:27 +01:00
parent e8c29226a1
commit f26267e572
3 changed files with 12 additions and 2 deletions

View File

@ -50,6 +50,10 @@ public class PirateChainWalletController extends Thread {
// Nothing to do yet
continue;
}
if (this.currentWallet.isNullSeedWallet()) {
// Don't sync the null seed wallet
continue;
}
LOGGER.debug("Syncing Pirate Chain wallet...");
String response = LiteWalletJni.execute("sync", "");

View File

@ -439,7 +439,6 @@ public class PirateChain extends Bitcoiny {
PirateChainWalletController walletController = PirateChainWalletController.getInstance();
walletController.initNullSeedWallet();
walletController.ensureInitialized();
walletController.ensureSynchronized();
walletController.getCurrentWallet().unlock();
@ -491,7 +490,6 @@ public class PirateChain extends Bitcoiny {
PirateChainWalletController walletController = PirateChainWalletController.getInstance();
walletController.initNullSeedWallet();
walletController.ensureInitialized();
walletController.ensureSynchronized();
walletController.getCurrentWallet().unlock();

View File

@ -190,6 +190,10 @@ public class PirateWallet {
LOGGER.info("Error: can't save wallet, because no wallet it initialized");
return false;
}
if (this.isNullSeedWallet()) {
// Don't save wallets that have a null seed
return false;
}
// Encrypt first (will do nothing if already encrypted)
this.encrypt();
@ -218,6 +222,10 @@ public class PirateWallet {
}
public String load() throws IOException {
if (this.isNullSeedWallet()) {
// Don't load wallets that have a null seed
return null;
}
Path walletPath = this.getCurrentWalletPath();
if (!Files.exists(walletPath)) {
return null;