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.
This is a shortcut fix. Instead of replicating the zip244 transaction
logic that's implemented in librustzcash:
zcash_primitives/src/transaction/components/orchard.rs
cheat by calling getblock with verbose level 1, which prints the txid
of each transaction. This currently requires calling getblock twice,
once for the raw hex (as we have always done), and again to get the
transaction IDs. An easy improvement would be to add the raw hex to
verbosity 1 result. (Or have a new verbosity that shows both.)
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.
This commit is based on adityapk00 streaming mempool interface but
avoids using goroutines, which are difficult to reason about.
Co-authored-by: Aditya Kulkarni <adityapk@gmail.com>
* Prices API
* Add current prices
* Historical prices persist
* Add mutexs
* multiple providers
* Handle startup
* Edge case where historical price is requested for current
* fix median edge case
* Don't return too old last price
* bug fixes
* price metrics and logging
* warnings
Add a new darksidewallet gRPC to add a utxo that can be returned by the
production GetAddressUtxos, for example:
grpcurl -plaintext -d '{"address":"t1g1HQJuwDoStGrYYLj8VhLu1J5igd8TNXV","txid":"1zjB42Z7FtwRZOBNMlTubCgx9l3dsZSqXxmWpuZXJto=","script": "dqkU8saQsCVS4mNwcByoGCtfOaHFaCiIrA==","valueZat": "3010000","height": "686773"}' localhost:9067 cash.z.wallet.sdk.rpc.DarksideStreamer/AddAddressUtxo
Then the following returns this entry:
grpcurl -plaintext -d '{"startHeight":0,"maxEntries":2,"addresses":["t1g1HQJuwDoStGrYYLj8VhLu1J5igd8TNXV"]}' localhost:9067 cash.z.wallet.sdk.rpc.CompactTxStreamer/GetAddressUtxos
You can also clear the list of entries:
grpcurl -plaintext localhost:9067 cash.z.wallet.sdk.rpc.DarksideStreamer/ClearAddressUtxo
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.
Deserialize blocks and transactions as they are staged, to catch errors
earlier (such as trying to stage transactions as blocks), improve logging,
improve error handling (don't crash if ApplyStaged is given a height
that's higher than one beyond the latest active block).