Add current-receive-addr action to wallet-tool.

This commit is contained in:
Andreas Schildbach 2015-01-26 14:55:19 +01:00
parent c72c48cd58
commit 815c4b9ced
2 changed files with 9 additions and 0 deletions

View File

@ -166,6 +166,7 @@ public class WalletTool {
ADD_KEY,
ADD_ADDR,
DELETE_KEY,
CURRENT_RECEIVE_ADDR,
SYNC,
RESET,
SEND,
@ -342,6 +343,7 @@ public class WalletTool {
case ADD_KEY: addKey(); break;
case ADD_ADDR: addAddr(); break;
case DELETE_KEY: deleteKey(); break;
case CURRENT_RECEIVE_ADDR: currentReceiveAddr(); break;
case RESET: reset(); break;
case SYNC: syncChain(); break;
case SEND:
@ -1074,6 +1076,11 @@ public class WalletTool {
wallet.removeKey(key);
}
private static void currentReceiveAddr() {
ECKey key = wallet.currentReceiveKey();
System.out.println(key.toAddress(params) + " " + key);
}
private static void dumpWallet() throws BlockStoreException {
// Setup to get the chain height so we can estimate lock times, but don't wipe the transactions if it's not
// there just for the dump case.

View File

@ -21,6 +21,8 @@ Usage: wallet-tool --flags action-name
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.
current-receive-addr Prints the current receive address, deriving one if needed. Addresses derived with this action are
independent of addresses derived with the add-key action.
sync Sync the wallet with the latest block chain (download new transactions).
If the chain file does not exist this will RESET the wallet.
reset Deletes all transactions from the wallet, for if you want to replay the chain.