Skip to content

Commit

Permalink
Returns isvalid: false instead of conversion error
Browse files Browse the repository at this point in the history
  • Loading branch information
arya2 committed Feb 2, 2023
1 parent 332b55c commit a45bff8
Showing 1 changed file with 8 additions and 7 deletions.
15 changes: 8 additions & 7 deletions zebra-rpc/src/methods/get_block_template_rpcs.rs
Original file line number Diff line number Diff line change
Expand Up @@ -792,13 +792,14 @@ where
return Ok(validate_address::Response::invalid());
};

let address = address
.convert::<primitives::Address>()
.map_err(|err| Error {
code: ErrorCode::ServerError(0),
message: format!("conversion error: {err}"),
data: None,
})?;
let address = match address
.convert::<primitives::Address>() {
Ok(address) => address,
Err(err) => {
tracing::debug!(?err, "conversion error");
return Ok(validate_address::Response::invalid());
}
};

// we want to match zcashd's behaviour
if !address.is_transparent() {
Expand Down

0 comments on commit a45bff8

Please sign in to comment.