Commit Graph

15 Commits

Author SHA1 Message Date
Larry Ruane 0d00588941 Get unit tests working again
Now "go test ./..." passes, it had broken due to the V5 transaction
(NU5) changes in #392. I didn't have time to fix the tests at the time.
Also, this fixes a few lint problems.
2022-06-12 12:50:42 -06:00
Larry Ruane ba1b931986 add --sync-from-height command-line option
This causes lightwalletd to discard cached blocks at the given height
and beyond. This in turn causes it to re-fetch those blocks from zcashd.
It's similar to --redownload, except that option discards all blocks
(equivalent to --sync-from-height 0, but the existing --redownload is
retained for compatibility).

This is mostly intended for testing. It's sometimes useful to force the
node to (re)sync some recent blocks, but redownloading all of them takes
around an hour.
2022-05-24 15:17:38 -05:00
Larry Ruane bdaac63f3e improve reorg by using getbestblockhash 2021-08-30 16:41:24 -06:00
Larry Ruane b1f3687d83 add MempoolStream unit test 2021-07-29 13:47:53 -06:00
Larry Ruane 6357f7f15b Refactor mock Sleep, add mock Now time function
Instead of the Sleep function pointer being a standalong global
variable, move it into a new Time struct, and add a Now function
pointer, so that time.Now() can be mocked. Time.Now() isn't used yet.
This will be cleaner if we need to mock more time-related functions in
the future.
2021-07-29 13:47:53 -06:00
Larry Ruane a4cc08b89e GetBlockRange: allow start < end, return blocks in reverse order 2021-05-18 15:38:26 -06:00
Larry Ruane d7f35f2713 fix database file location bug introduced by PR320
PR 320 introduced a bug that causes the `blocks` and `lengths` database
files to be located one directory level higher than it they should be.

The bug doesn't cause any functional problem, it only makes the
lightwalletd do more work (re-download the block cache), and it also
makes it not possible to switch between testnet and mainnet.

This patch locates the database files back where they belong.
2021-01-11 12:19:51 -07:00
Larry Ruane 33e7312218 add zcashd versioning to GetLightdInfo result 2020-12-03 22:55:08 -07:00
Larry Ruane 7381129740 add GetMempoolTx() 2020-09-10 14:01:01 -06:00
Larry Ruane 38d71a8f1d don't sleep 1s for reorg, wait 2s for new blocks 2020-05-21 11:48:03 -06:00
Larry Ruane 9371f984ae GetBlockRange: don't pass mutex in channel (linter warning) 2020-05-21 11:48:03 -06:00
Larry Ruane 8974cd1586 fix merge conflicts while rebasing onto file-cache branch 2020-04-24 16:55:47 -06:00
Larry Ruane 1ff6ea4091 move block cache from memory to files 2020-04-08 18:10:50 -06:00
Larry Ruane 1dc439080b add COPYING and copyright lines 2020-03-12 12:02:55 -06:00
Larry Ruane a4f968823f test improvements, and minor cleanups 2020-01-31 16:36:31 -07:00