zcash_client_backend: Count `tags` in `impl DynamicUsage for Batch`
This commit is contained in:
parent
f78c91fd0c
commit
fe258ca120
|
@ -124,15 +124,19 @@ where
|
|||
Output: ShieldedOutput<D, COMPACT_NOTE_SIZE>,
|
||||
{
|
||||
fn dynamic_usage(&self) -> usize {
|
||||
// We don't have a `DynamicUsage` bound on `D::IncomingViewingKey`, `D`, or
|
||||
// We don't have a `DynamicUsage` bound on `A`, `D::IncomingViewingKey`, `D`, or
|
||||
// `Output`, and we can't use newtypes because the batch decryption API takes
|
||||
// slices. But we know that we don't allocate memory inside either of these, so we
|
||||
// just compute the size directly.
|
||||
base_vec_usage(&self.ivks) + base_vec_usage(&self.outputs) + self.repliers.dynamic_usage()
|
||||
base_vec_usage(&self.tags)
|
||||
+ base_vec_usage(&self.ivks)
|
||||
+ base_vec_usage(&self.outputs)
|
||||
+ self.repliers.dynamic_usage()
|
||||
}
|
||||
|
||||
fn dynamic_usage_bounds(&self) -> (usize, Option<usize>) {
|
||||
let base_usage = base_vec_usage(&self.ivks) + base_vec_usage(&self.outputs);
|
||||
let base_usage =
|
||||
base_vec_usage(&self.tags) + base_vec_usage(&self.ivks) + base_vec_usage(&self.outputs);
|
||||
let bounds = self.repliers.dynamic_usage_bounds();
|
||||
(
|
||||
base_usage + bounds.0,
|
||||
|
|
Loading…
Reference in New Issue