diff --git a/zcash_client_backend/proto/service.proto b/zcash_client_backend/proto/service.proto index 2f11c25a1..0a34be42a 100644 --- a/zcash_client_backend/proto/service.proto +++ b/zcash_client_backend/proto/service.proto @@ -36,8 +36,7 @@ message TxFilter { // by GetMempoolStream(), the latest block height. // // FIXME: the documentation here about mempool status contradicts the documentation -// for the `height` field (which I hope is correct, and this doesn't give the latest -// block height for mempool transactions.) +// for the `height` field. See https://github.com/zcash/librustzcash/issues/1484 message RawTransaction { bytes data = 1; // exact data returned by Zcash 'getrawtransaction' uint64 height = 2; // height that the transaction was mined (or -1) diff --git a/zcash_client_backend/src/data_api.rs b/zcash_client_backend/src/data_api.rs index dc55922cc..47b26c4ef 100644 --- a/zcash_client_backend/src/data_api.rs +++ b/zcash_client_backend/src/data_api.rs @@ -549,8 +549,8 @@ pub enum TransactionDataRequest { /// /// The caller evaluating this request on behalf of the wallet backend should respond to this /// request by determining the status of the specified transaction with respect to the main - /// chain; if using `lightwalletd` for access to chain data, this may be performed interpreting - /// the results of the [`GetTransaction`] RPC method. It should then call + /// chain; if using `lightwalletd` for access to chain data, this may be obtained by + /// interpreting the results of the [`GetTransaction`] RPC method. It should then call /// [`WalletWrite::set_transaction_status`] to provide the resulting transaction status /// information to the wallet backend. /// diff --git a/zcash_client_backend/src/proto/service.rs b/zcash_client_backend/src/proto/service.rs index 85652abc3..bf55bc163 100644 --- a/zcash_client_backend/src/proto/service.rs +++ b/zcash_client_backend/src/proto/service.rs @@ -40,8 +40,7 @@ pub struct TxFilter { /// by GetMempoolStream(), the latest block height. /// /// FIXME: the documentation here about mempool status contradicts the documentation -/// for the `height` field (which I hope is correct, and this doesn't give the latest -/// block height for mempool transactions.) +/// for the `height` field. See #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct RawTransaction { diff --git a/zcash_client_sqlite/src/lib.rs b/zcash_client_sqlite/src/lib.rs index 6ce88f0e5..3c5a8a482 100644 --- a/zcash_client_sqlite/src/lib.rs +++ b/zcash_client_sqlite/src/lib.rs @@ -593,9 +593,8 @@ impl, P: consensus::Parameters> WalletRead for W } fn transaction_data_requests(&self) -> Result, Self::Error> { - let iter = std::iter::empty(); + let iter = wallet::transaction_data_requests(self.conn.borrow())?.into_iter(); - let iter = iter.chain(wallet::transaction_data_requests(self.conn.borrow())?.into_iter()); #[cfg(feature = "transparent-inputs")] let iter = iter.chain( wallet::transparent::transaction_data_requests(self.conn.borrow(), &self.params)? @@ -1211,6 +1210,7 @@ impl WalletWrite for WalletDb #[cfg(feature = "transparent-inputs")] let detectable_via_scanning = { + #[allow(unused_mut)] let mut detectable_via_scanning = d_tx.tx().sapling_bundle().is_some(); #[cfg(feature = "orchard")] { detectable_via_scanning |= d_tx.tx().orchard_bundle().is_some(); @@ -1450,7 +1450,7 @@ impl WalletWrite for WalletDb // in transaction pairs sending to a ZIP 320 address) it becomes // possible that the spend of these outputs is not then later detected // if the transaction that spends them is purely transparent. This is - // particularly a problem in wallet recovery. + // especially a problem in wallet recovery. wallet::transparent::queue_transparent_spend_detection( wdb.conn.0, &wdb.params, diff --git a/zcash_client_sqlite/src/wallet.rs b/zcash_client_sqlite/src/wallet.rs index 92b4ff934..28341dbea 100644 --- a/zcash_client_sqlite/src/wallet.rs +++ b/zcash_client_sqlite/src/wallet.rs @@ -1975,7 +1975,7 @@ pub(crate) fn store_transaction_to_be_sent( } // Add the transaction to the set to be queried for transaction status. This is only necessary - // at present for fully-transparent transactions, because any transaction with a shielded + // at present for fully transparent transactions, because any transaction with a shielded // component will be detected via ordinary chain scanning and/or nullifier checking. if !detectable_via_scanning { queue_tx_retrieval( diff --git a/zcash_client_sqlite/src/wallet/transparent.rs b/zcash_client_sqlite/src/wallet/transparent.rs index 19433c626..1c2ab79db 100644 --- a/zcash_client_sqlite/src/wallet/transparent.rs +++ b/zcash_client_sqlite/src/wallet/transparent.rs @@ -500,7 +500,7 @@ pub(crate) fn transaction_data_requests( // because under ordinary circumstances, it is populated via a call from // `decrypt_and_store_transaction` on ordinary mined transaction data retrieved from the chain. let mut address_request_stmt = conn.prepare_cached( - "SELECT ssq.address, IFNULL(t.target_height, t.mined_height + 1) + "SELECT ssq.address, IFNULL(t.target_height, t.mined_height) FROM transparent_spend_search_queue ssq JOIN transactions t ON t.id_tx = ssq.transaction_id WHERE t.target_height IS NOT NULL