diff options
Diffstat (limited to 'src/main_gui.cpp')
| -rw-r--r-- | src/main_gui.cpp | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/src/main_gui.cpp b/src/main_gui.cpp index 2bcdb83..aa9c23d 100644 --- a/src/main_gui.cpp +++ b/src/main_gui.cpp | |||
| @@ -323,6 +323,16 @@ int main(int argc, char* argv[]) | |||
| 323 | // import having failed. | 323 | // import having failed. |
| 324 | if (nAdded > 0) | 324 | if (nAdded > 0) |
| 325 | { | 325 | { |
| 326 | string strScanError; | ||
| 327 | if (!CanScanWalletTransactions(strScanError)) | ||
| 328 | { | ||
| 329 | fprintf(stderr, "Cannot scan for imported coins: %s\n", | ||
| 330 | strScanError.c_str()); | ||
| 331 | fprintf(stderr, "The key import was written, but the wallet " | ||
| 332 | "balance was not proven against the chain.\n"); | ||
| 333 | DBFlush(true); | ||
| 334 | return 1; | ||
| 335 | } | ||
| 326 | printf("Looking through the chain for coins belonging to the imported key(s)...\n"); | 336 | printf("Looking through the chain for coins belonging to the imported key(s)...\n"); |
| 327 | int nFound = ScanForWalletTransactions(pindexGenesisBlock); | 337 | int nFound = ScanForWalletTransactions(pindexGenesisBlock); |
| 328 | printf("Found %d transaction(s). Start the node normally to see the balance.\n", nFound); | 338 | printf("Found %d transaction(s). Start the node normally to see the balance.\n", nFound); |
| @@ -339,6 +349,14 @@ int main(int argc, char* argv[]) | |||
| 339 | // balance is wrong for this reason. | 349 | // balance is wrong for this reason. |
| 340 | if (arg(argc,argv,"/rescan") || arg(argc,argv,"-rescan")) | 350 | if (arg(argc,argv,"/rescan") || arg(argc,argv,"-rescan")) |
| 341 | { | 351 | { |
| 352 | string strScanError; | ||
| 353 | if (!CanScanWalletTransactions(strScanError)) | ||
| 354 | { | ||
| 355 | fprintf(stderr, "Cannot rescan wallet transactions: %s\n", | ||
| 356 | strScanError.c_str()); | ||
| 357 | DBFlush(true); | ||
| 358 | return 1; | ||
| 359 | } | ||
| 342 | printf("Rescanning the chain for this wallet's transactions...\n"); | 360 | printf("Rescanning the chain for this wallet's transactions...\n"); |
| 343 | int nFound = ScanForWalletTransactions(pindexGenesisBlock); | 361 | int nFound = ScanForWalletTransactions(pindexGenesisBlock); |
| 344 | printf("Rescan done: %d transaction(s) added or updated.\n", nFound); | 362 | printf("Rescan done: %d transaction(s) added or updated.\n", nFound); |