WalletTool: extract common code from dumpWallet() into printWallet()

This commit is contained in:
Sean Gilligan 2022-02-22 11:20:02 -08:00 committed by Andreas Schildbach
parent f411dcd634
commit 0a1e1ca8a0

View file

@ -1255,16 +1255,20 @@ public class WalletTool implements Callable<Integer> {
final KeyParameter aesKey = passwordToKey(true);
if (aesKey == null)
return; // Error message already printed.
System.out.println(wallet.toString(dumpLookAhead, true, aesKey, true, true, chain));
printWallet( aesKey);
} else {
System.err.println("Can't dump privkeys, wallet is encrypted.");
return;
}
} else {
System.out.println(wallet.toString(dumpLookAhead, dumpPrivKeys, null, true, true, chain));
printWallet( null);
}
}
private void printWallet(@Nullable KeyParameter aesKey) {
System.out.println(wallet.toString(dumpLookAhead, dumpPrivKeys, aesKey, true, true, chain));
}
private void setCreationTime() {
long creationTime = getCreationTimeSeconds();
for (DeterministicKeyChain chain : wallet.getActiveKeyChains()) {