Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(api): consider expiration return addresses for ledger updates #1314

Merged
merged 17 commits into from
Jan 24, 2024
Prev Previous commit
Next Next commit
nor does not exist for aggregation 🤷‍♀️
  • Loading branch information
Alex Coats committed Jan 22, 2024
commit 3573a439122c3cb8e8293cbecac50bce89dd94bd
6 changes: 3 additions & 3 deletions src/db/mongodb/collections/outputs/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -467,11 +467,11 @@ impl OutputCollection {
// If this output is trivially unlocked by this address
{ "$eq": [ "$details.address", &address ] },
{ "$cond": [
{ "$nor": [
{ "$and": [
// And the output has no expiration or is not expired
{ "$lte": [ "$output.expiration_unlock_condition.timestamp", ledger_ms.milestone_timestamp ] },
{ "$not": { "$lte": [ "$output.expiration_unlock_condition.timestamp", ledger_ms.milestone_timestamp ] } },
// and has no timelock or is past the lock period
{ "$gt": [ "$output.timelock_unlock_condition.timestamp", ledger_ms.milestone_timestamp ] }
{ "$not": { "$gt": [ "$output.timelock_unlock_condition.timestamp", ledger_ms.milestone_timestamp ] } }
] },
{ "$toDecimal": "$output_amount" }, 0
] },
Expand Down
Loading