mirror of
https://github.com/Qortal/altcoinj.git
synced 2025-11-03 05:57:21 +00:00
WalletTool: add a lookahead flag that lets you control the lookahead size on the receive branch. Update help text to reflect the new flag and the seed flag as well.
This commit is contained in:
@@ -87,6 +87,7 @@ public class WalletTool {
|
||||
private static ValidationMode mode;
|
||||
private static String password;
|
||||
private static org.bitcoin.protocols.payments.Protos.PaymentRequest paymentRequest;
|
||||
private static OptionSpec<Integer> lookaheadSize;
|
||||
|
||||
public static class Condition {
|
||||
public enum Type {
|
||||
@@ -206,6 +207,7 @@ public class WalletTool {
|
||||
parser.accepts("allow-unconfirmed");
|
||||
parser.accepts("offline");
|
||||
parser.accepts("ignore-mandatory-extensions");
|
||||
lookaheadSize = parser.accepts("lookahead-size").withRequiredArg().ofType(Integer.class);
|
||||
OptionSpec<String> passwordFlag = parser.accepts("password").withRequiredArg();
|
||||
OptionSpec<String> paymentRequestLocation = parser.accepts("payment-request").withRequiredArg();
|
||||
parser.accepts("no-pki");
|
||||
@@ -853,6 +855,11 @@ public class WalletTool {
|
||||
if (options.has("privkey") || options.has("pubkey")) {
|
||||
importKey();
|
||||
} else {
|
||||
if (options.has(lookaheadSize)) {
|
||||
Integer size = options.valueOf(lookaheadSize);
|
||||
log.info("Setting keychain lookahead size to {}", size);
|
||||
wallet.setKeychainLookaheadSize(size);
|
||||
}
|
||||
ECKey key = wallet.freshReceiveKey();
|
||||
System.out.println(key.toAddress(params) + " " + key);
|
||||
}
|
||||
|
||||
@@ -8,12 +8,14 @@ Usage: wallet-tool --flags action-name
|
||||
raw-dump Prints the wallet as a raw protobuf with no parsing or sanity checking applied.
|
||||
create Makes a new wallet in the file specified by --wallet.
|
||||
Will complain and require --force if the wallet already exists.
|
||||
If --seed is present, it should specify either a mnemonic code or hex/base58 raw seed bytes.
|
||||
add-key Adds a new key to the wallet, either specified or freshly generated.
|
||||
If --date is specified, that's the creation date.
|
||||
If --unixtime is specified, that's the creation time and it overrides --date.
|
||||
If --privkey is specified, use as a hex/base58 encoded private key.
|
||||
Don't specify --pubkey in that case, it will be derived automatically.
|
||||
If --pubkey is specified, use as a hex/base58 encoded non-compressed public key.
|
||||
If --lookahead-size is specified, pre-generate at least this many keys ahead of where we are.
|
||||
add-addr Requires --addr to be specified, and adds it as a watching address.
|
||||
delete-key Removes the key specified by --pubkey or --addr from the wallet.
|
||||
sync Sync the wallet with the latest block chain (download new transactions).
|
||||
|
||||
Reference in New Issue
Block a user