we expect unspent outputs but play it safe (#517)
This commit is contained in:
@@ -321,7 +321,8 @@ impl NodeClient for HTTPNodeClient {
|
||||
|
||||
let params = json!([start_index, end_index, max_outputs, Some(true)]);
|
||||
let res = self.send_json_request::<OutputListing>("get_unspent_outputs", ¶ms)?;
|
||||
for out in res.outputs {
|
||||
// We asked for unspent outputs via the api but defensively filter out spent outputs just in case.
|
||||
for out in res.outputs.into_iter().filter(|out| out.spent == false) {
|
||||
let is_coinbase = match out.output_type {
|
||||
api::OutputType::Coinbase => true,
|
||||
api::OutputType::Transaction => false,
|
||||
|
||||
Reference in New Issue
Block a user