wallet: Add ANY_TADDR special string to z_sendmany
When using this special string as the from address, non-coinbase UTXOs
from any transparent addresses within the wallet will be used to fund the
transaction. Change outputs will be sent to a new transparent address,
as with any other spend of transparent funds.
Closeszcash/zcash#3640.
depends: Switch to `cargo vendor` for Rust dependencies
When we first integrated Rust into our build system, we had two
limitations:
- We were building the `librustzcash` FFI library as a dependency, and
therefore needed access to its crate dependencies in the depends
system.
- Gitian builds happen offline, so we needed to fetch any crate
dependencies ahead of time, and then configure cargo to use these in
an offline environment.
At the time, `cargo` already had support for "Source Replacement", but
there was no easy way to package the dependencies in the necessary way.
What we implemented was effectively the `cargo-vendor` tool, built using
Makefiles. A noticeable downside was that we were pinning dependencies
twice: once in the `Cargo.lock` for the FFI library, and again in our
depends system.
Since then, `cargo-vendor` has been upstreamed into `cargo` itself, and
we have moved `librustzcash` into this repository. We can therefore use
`cargo vendor` directly from our pinned Rust compiler to fetch the
dependencies, and rely on our local `Cargo.lock` to pin the specific
crates we are relying on.
During Gitian builds, SOURCES_PATH is set to a path within the Gitian
cache. Normally this path is created as part of creating a particular
dependency's source directory, but in some situations we may vendor Rust
crates before this folder exists.
When we first integrated Rust into our build system, we had two
limitations:
- We were building the `librustzcash` FFI library as a dependency, and
therefore needed access to its crate dependencies in the depends
system.
- Gitian builds happen offline, so we needed to fetch any crate
dependencies ahead of time, and then configure cargo to use these in
an offline environment.
At the time, `cargo` already had support for "Source Replacement", but
there was no easy way to package the dependencies in the necessary way.
What we implemented was effectively the `cargo-vendor` tool, built using
Makefiles. A noticeable downside was that we were pinning dependencies
twice: once in the `Cargo.lock` for the FFI library, and again in our
depends system.
Since then, `cargo-vendor` has been upstreamed into `cargo` itself, and
we have moved `librustzcash` into this repository. We can therefore use
`cargo vendor` directly from our pinned Rust compiler to fetch the
dependencies, and rely on our local `Cargo.lock` to pin the specific
crates we are relying on.
Allow multiple nuparams options in config file
We didn't add this in zcash/zcash#4583 because `-nuparams` is only ever
used as a CLI argument in our testing infrastructure. It turns out that
there are external developers using regtest mode with `nuparams` in
their config files instead. Neat!
Closeszcash/zcash#4705.
After CWallet::ChainTipAdded() updates the witness data, it
may flush it to disk (SetBestChain()); make sure the locator
part is consistent with the witnesses (height).
We didn't add this in zcash/zcash#4583 because `-nuparams` is only ever
used as a CLI argument in our testing infrastructure. It turns out that
there are external developers using regtest mode with `nuparams` in
their config files instead. Neat!
Closeszcash/zcash#4705.
add shielded balance to getwalletinfo
Closeszcash/zcash#3939
It is based on the definition that unconfirmed balance has 0 confirmations; anything else is regular balance.
Implementation:
1. `getBalanceZaddr` uses one version of `GetFilteredNotes`, we want to use the other version that allow us to get balances inside min and max confirmations.
2. `shielded_unconfirmed_balance`, and `shielded_balance` are obtained by calling `getBalanceZaddr` with different min and max confirmations according to the definitions from above.
Prevent creation of shielded transactions when chain is not synced up
Part of zcash/zcash#3996.
Inspired by jl777/komodo#1486 and jl777/komodo#1493, but takes a different approach:
- Uses a function `ThrowIfInitialBlockDownload()` that checks `IsInitialBlockDownload()`, instead of macros.
- Added `initial_block_download_complete` output only to `getblockchaininfo`.
When using this special string as the from address, UTXOs from any
transparent addresses within the wallet will be used to fund the
transaction. Change outputs will be sent to a new transparent address,
as with any other spend of transparent funds.
Closeszcash/zcash#3640.