mirror of
https://github.com/Blockstream/satellite-api.git
synced 2025-02-21 21:31:37 +01:00
Fix criteria for transitioning into received state
Since there can be multiple Tx confirmations for the same region, we should not check if the number of Tx confirmations matches with the number of regions. Instead, we should check if all regions have at least one Tx confirmation.
This commit is contained in:
parent
c4bf6f1a90
commit
aabdc11e24
1 changed files with 6 additions and 1 deletions
|
@ -92,7 +92,12 @@ class Order < ActiveRecord::Base
|
|||
end
|
||||
|
||||
def received_criteria_met?
|
||||
(self.tx_confirmations.count == Region.count) &&
|
||||
self.tx_regions.exists?(Region::REGIONS[:north_america].id) &&
|
||||
self.tx_regions.exists?(Region::REGIONS[:south_america].id) &&
|
||||
self.tx_regions.exists?(Region::REGIONS[:africa].id) &&
|
||||
self.tx_regions.exists?(Region::REGIONS[:europe].id) &&
|
||||
self.tx_regions.exists?(Region::REGIONS[:asia_c].id) &&
|
||||
self.tx_regions.exists?(Region::REGIONS[:asia_ku].id) &&
|
||||
self.rx_regions.exists?(Region::REGIONS[:north_america].id) &&
|
||||
self.rx_regions.exists?(Region::REGIONS[:south_america].id) &&
|
||||
self.rx_regions.exists?(Region::REGIONS[:asia_c].id) &&
|
||||
|
|
Loading…
Add table
Reference in a new issue