mirror of
https://github.com/mimblewimble/grin-wallet.git
synced 2025-01-20 19:11:09 +03:00
we expect unspent outputs but play it safe (#517)
This commit is contained in:
parent
073c63aa16
commit
8077d01004
1 changed files with 2 additions and 1 deletions
|
@ -321,7 +321,8 @@ impl NodeClient for HTTPNodeClient {
|
||||||
|
|
||||||
let params = json!([start_index, end_index, max_outputs, Some(true)]);
|
let params = json!([start_index, end_index, max_outputs, Some(true)]);
|
||||||
let res = self.send_json_request::<OutputListing>("get_unspent_outputs", ¶ms)?;
|
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 {
|
let is_coinbase = match out.output_type {
|
||||||
api::OutputType::Coinbase => true,
|
api::OutputType::Coinbase => true,
|
||||||
api::OutputType::Transaction => false,
|
api::OutputType::Transaction => false,
|
||||||
|
|
Loading…
Reference in a new issue