Skip to content

Commit

Permalink
Fix regression in output padding
Browse files Browse the repository at this point in the history
Closes #121.
  • Loading branch information
str4d committed Feb 12, 2024
1 parent ab3aea5 commit 940886a
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,12 @@ and this library adheres to Rust's notion of

## [Unreleased]

### Fixed
- `sapling_crypto::builder::BundleType::num_outputs` now matches the previous
behaviour for Sapling bundle padding, by including dummy outputs if there are
no requested outputs but some requested spends, and `bundle_required` is set
to `false` (as in `BundleType::DEFAULT`).

## [0.1.0] - 2024-01-26
The crate has been completely rewritten. See [`zcash/librustzcash`] for the
history of this rewrite.
Expand Down
2 changes: 1 addition & 1 deletion src/builder.rs
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ impl BundleType {
) -> Result<usize, &'static str> {
match self {
BundleType::Transactional { bundle_required } => {
Ok(if *bundle_required || requested_outputs > 0 {
Ok(if *bundle_required || requested_spends > 0 || requested_outputs > 0 {
core::cmp::max(requested_outputs, MIN_SHIELDED_OUTPUTS)
} else {
0
Expand Down

0 comments on commit 940886a

Please sign in to comment.