Skip to content

Commit

Permalink
fix balance calculation
Browse files Browse the repository at this point in the history
  • Loading branch information
Alex Coats committed Jan 17, 2024
1 parent 56de8e6 commit 86dc2a2
Showing 1 changed file with 3 additions and 6 deletions.
9 changes: 3 additions & 6 deletions src/db/mongodb/collections/outputs/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -455,17 +455,14 @@ impl OutputCollection {
{ "$or": [
{ "$and": [
{ "$eq": [ "$details.address", &address ] },
{ "$or": [
{ "$eq": [ "$details.is_trivial_unlock", true ] },
{ "$not": { "$lt": [ "$output.timelock_unlock_condition.timestamp", ledger_ms.milestone_timestamp ] } }
] }
{ "$not": { "$gt": [ "$output.timelock_unlock_condition.timestamp", ledger_ms.milestone_timestamp ] } }
] },
{ "$and": [
{ "$eq": [ "$output.expiration_unlock_condition.return_address", &address ] },
{ "$not": { "$lt": [ "$output.expiration_unlock_condition.timestamp", ledger_ms.milestone_timestamp ] } },
{ "$gt": [ "$output.expiration_unlock_condition.timestamp", ledger_ms.milestone_timestamp ] }
] },
] },
{ "$toDecimal": "$output.amount" }, 0
{ "$toDecimal": "$output.amount" }, 0
]
} },
} },
Expand Down

0 comments on commit 86dc2a2

Please sign in to comment.