forked from Qortal/qortal
Fixed bugs in wallet initialization
This commit is contained in:
parent
fa4679dcc4
commit
bbf7193c51
@ -106,6 +106,9 @@ public class PirateChainWalletController extends Thread {
|
||||
|
||||
try {
|
||||
this.currentWallet = new PirateWallet(entropyBytes);
|
||||
if (!this.currentWallet.isReady()) {
|
||||
this.currentWallet = null;
|
||||
}
|
||||
return true;
|
||||
} catch (IOException e) {
|
||||
LOGGER.info("Unable to initialize wallet: {}", e.getMessage());
|
||||
|
@ -78,8 +78,8 @@ public class PirateWallet {
|
||||
String outputSeedResponse = LiteWalletJni.initfromseed(SERVER_URI, this.params, inputSeedPhrase, "1886500", this.saplingOutput64, this.saplingSpend64); // Thread-safe.
|
||||
JSONObject outputSeedJson = new JSONObject(outputSeedResponse);
|
||||
String outputSeedPhrase = null;
|
||||
if (outputSeedJson.has("seedPhrase")) {
|
||||
outputSeedJson.getString("seedPhrase");
|
||||
if (outputSeedJson.has("seed")) {
|
||||
outputSeedPhrase = outputSeedJson.getString("seed");
|
||||
}
|
||||
|
||||
// Ensure seed phrase in response matches supplied seed phrase
|
||||
@ -104,6 +104,10 @@ public class PirateWallet {
|
||||
return false;
|
||||
}
|
||||
|
||||
public boolean isReady() {
|
||||
return this.ready;
|
||||
}
|
||||
|
||||
public void setReady(boolean ready) {
|
||||
this.ready = ready;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user