update command lastblocks and update helps
@@ -314,11 +314,9 @@ void processXferCommand(char *nextParam, FILE *out, int ispwd, uint32_t* pwd)
void processLastBlocksCommand(char *nextParam, FILE *out)
{
- int blocksCount;
+ int blocksCount = 20;
char *cmd = strtok_r(nextParam, " \t\r\n", &nextParam);
- if(!cmd) {
- fprintf(out, "Blocks count is not specified.\n");
- } else if(sscanf(cmd, "%d", &blocksCount) != 1 || blocksCount <= 0) {
+ if((cmd && sscanf(cmd, "%d", &blocksCount) != 1) || blocksCount <= 0) {
fprintf(out, "Illegal number.\n");
} else {
//100 is limit
@@ -590,6 +588,7 @@ void printHelp(FILE *out)
" account [N] - print first N (20 by default) our addresses with their amounts\n"
" balance [A] - print balance of the address A or total balance for all our addresses\n"
" block [A] - print extended info for the block corresponding to the address or hash A\n"
+ " lastblocks [N] - print latest N (20 by default, max limit 100) main blocks\n"
" exit - exit this program (not the daemon)\n"
" help - print this help\n"
" keygen - generate new private/public key pair and set it by default\n"
