Reconcile getbalance and listaccounts 0 in the shared-wallet case

If you copied your wallet and used it on two different machines, the balance reported by getbalance and the sum(listaccounts) could disagree, because you might receive payments for an address that is in your wallet but not your address book.  Now all such transactions are credited to the default empty-string account.
This commit is contained in:
Gavin Andresen
2011-01-20 13:10:01 -05:00
parent 1d23c74361
commit d9574c2f14
3 changed files with 29 additions and 2 deletions

View File

@@ -346,6 +346,9 @@ bool AppInit2(int argc, char* argv[])
return false;
}
if (GetBoolArg("-rescan"))
ScanForWalletTransactions(pindexGenesisBlock);
// Add wallet transactions that aren't already in a block to mapTransactions
ReacceptWalletTransactions();