Skip to content

Commit

Permalink
Optimize GetValidUTXOs
Browse files Browse the repository at this point in the history
  • Loading branch information
lochjin authored and dindinw committed Jun 1, 2024
1 parent d739ebc commit a9e6fda
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
1 change: 1 addition & 0 deletions services/acct/api.go
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,7 @@ func (api *PublicAccountManagerAPI) GetValidUTXOs(addr string, amount uint64) (i
amount = math.MaxUint64
}
ret.UTXOs, ret.Amount, err = api.a.GetUTXOs(addr, nil, &locked, &amount)
ret.Total = len(ret.UTXOs)
return ret, err
}

Expand Down
2 changes: 1 addition & 1 deletion services/acct/utils.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ type UTXOResult struct {

type ValidUTXOsResult struct {
Amount uint64 `json:"amount"`
Num int `json:"total"`
Total int `json:"total"`
UTXOs []UTXOResult `json:"utxos,omitempty"`
}

Expand Down

0 comments on commit a9e6fda

Please sign in to comment.