mirror of
https://github.com/Blockstream/satellite-api.git
synced 2024-11-19 04:50:01 +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
@ -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…
Reference in New Issue
Block a user