mirror of
https://github.com/bitcoinj/bitcoinj.git
synced 2025-02-23 06:35:17 +01:00
WalletTool: extract common code from dumpWallet() into printWallet()
This commit is contained in:
parent
f411dcd634
commit
0a1e1ca8a0
1 changed files with 6 additions and 2 deletions
|
@ -1255,16 +1255,20 @@ public class WalletTool implements Callable<Integer> {
|
||||||
final KeyParameter aesKey = passwordToKey(true);
|
final KeyParameter aesKey = passwordToKey(true);
|
||||||
if (aesKey == null)
|
if (aesKey == null)
|
||||||
return; // Error message already printed.
|
return; // Error message already printed.
|
||||||
System.out.println(wallet.toString(dumpLookAhead, true, aesKey, true, true, chain));
|
printWallet( aesKey);
|
||||||
} else {
|
} else {
|
||||||
System.err.println("Can't dump privkeys, wallet is encrypted.");
|
System.err.println("Can't dump privkeys, wallet is encrypted.");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
} else {
|
} 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() {
|
private void setCreationTime() {
|
||||||
long creationTime = getCreationTimeSeconds();
|
long creationTime = getCreationTimeSeconds();
|
||||||
for (DeterministicKeyChain chain : wallet.getActiveKeyChains()) {
|
for (DeterministicKeyChain chain : wallet.getActiveKeyChains()) {
|
||||||
|
|
Loading…
Add table
Reference in a new issue