Skip to content

Commit

Permalink
Code quality: Use {} in if oneliners
Browse files Browse the repository at this point in the history
  • Loading branch information
oscarguindzberg committed Sep 17, 2020
1 parent 7bdae1b commit 78c1a57
Showing 1 changed file with 12 additions and 6 deletions.
18 changes: 12 additions & 6 deletions core/src/main/java/bisq/core/btc/setup/WalletConfig.java
Original file line number Diff line number Diff line change
Expand Up @@ -490,14 +490,20 @@ protected Wallet createWallet(boolean isBsqWallet) {
Script.ScriptType preferredOutputScriptType = Script.ScriptType.P2PKH;
KeyChainGroupStructure structure = new BisqKeyChainGroupStructure(isBsqWallet);
KeyChainGroup.Builder kcg = KeyChainGroup.builder(params, structure);
if (restoreFromSeed != null)
if (restoreFromSeed != null) {
kcg.fromSeed(restoreFromSeed, preferredOutputScriptType).build();
else if (restoreFromKey != null)
} else if (restoreFromKey != null) {
kcg.addChain(DeterministicKeyChain.builder().spend(restoreFromKey).outputScriptType(preferredOutputScriptType).build());
else if (!isBsqWallet)
kcg.fromRandom(preferredOutputScriptType);
else
kcg.fromSeed(vBtcWallet.getKeyChainSeed(), preferredOutputScriptType);
} else {
// new wallet
if (!isBsqWallet) {
// btc wallet uses a new random seed.
kcg.fromRandom(preferredOutputScriptType);
} else {
// bsq wallet uses btc wallet's seed created a few milliseconds ago.
kcg.fromSeed(vBtcWallet.getKeyChainSeed(), preferredOutputScriptType);
}
}
if (walletFactory != null) {
return walletFactory.create(params, kcg.build());
} else {
Expand Down

0 comments on commit 78c1a57

Please sign in to comment.