lbrycrd/src/wallet/test
Russell Yanofsky 30abce7a99 Improve ScanForWalletTransactions return value
Change ScanForWalletTransactions return value so it is possible to distinguish
scans that skip reading every block (due to the nTimeFirstKey optimization)
from scans that fail while reading the chainActive.Tip() block. Return value is
now non-null in the non-failing case.

This change doesn't affect any user-visible behavior, it is only an internal
API improvement. The only code currently using the ScanForWalletTransactions
return value is in importmulti, and importmulti always calls
ScanForWalletTransactions with a pindex pointing to the first block in
chainActive whose block time is >= (nLowestTimestamp - 7200), while
ScanForWalletTransactions would only return null without reading blocks when
pindex and every block after it had a block time < (nTimeFirstKey - 7200).
These conditions could never happen at the same time because nTimeFirstKey <=
nLowestTimestamp.

I'm planning to make a more substantial API improvement in the future (making
ScanForWalletTransactions private and exposing a higher level rescan method to
RPC code), but Matt Corallo <git@bluematt.me> pointed out this odd behavior
introduced by e2e2f4c "Return errors from importmulti if complete rescans are
not successful" yesterday, so I'm following up now to get rid of badness
introduced by that merge.
2017-03-01 05:16:24 -05:00
..
accounting_tests.cpp Increment MIT Licence copyright header year on files modified in 2016 2016-12-31 11:01:21 -07:00
crypto_tests.cpp Increment MIT Licence copyright header year on files modified in 2016 2016-12-31 11:01:21 -07:00
wallet_test_fixture.cpp Add copyright header to wallet_text_fixture.cpp 2016-08-22 09:24:50 +02:00
wallet_test_fixture.h test: Create test fixture for wallet 2016-04-18 14:57:42 +02:00
wallet_tests.cpp Improve ScanForWalletTransactions return value 2017-03-01 05:16:24 -05:00