Skip to content

Commit

Permalink
Fix to unwraps (#285)
Browse files Browse the repository at this point in the history
  • Loading branch information
yeastplume authored Jan 2, 2020
1 parent 458fdbc commit cf47c1d
Showing 1 changed file with 23 additions and 3 deletions.
26 changes: 23 additions & 3 deletions impls/src/node_clients/http.rs
Original file line number Diff line number Diff line change
Expand Up @@ -262,15 +262,35 @@ impl NodeClient for HTTPNodeClient {
api::OutputType::Coinbase => true,
api::OutputType::Transaction => false,
};
let range_proof = match out.range_proof() {
Ok(r) => r,
Err(e) => {
let msg = format!("Unexpected error in returned output (missing range proof): {:?}. {:?}, {}",
out.commit,
out,
e);
error!("{}", msg);
Err(libwallet::ErrorKind::ClientCallback(msg))?
}
};
let block_height = match out.block_height {
Some(h) => h,
None => {
let msg = format!("Unexpected error in returned output (missing block height): {:?}. {:?}",
out.commit,
out);
error!("{}", msg);
Err(libwallet::ErrorKind::ClientCallback(msg))?
}
};
api_outputs.push((
out.commit,
out.range_proof().unwrap(),
range_proof,
is_coinbase,
out.block_height.unwrap(),
block_height,
out.mmr_index,
));
}

Ok((o.highest_index, o.last_retrieved_index, api_outputs))
}
Err(e) => {
Expand Down

0 comments on commit cf47c1d

Please sign in to comment.