diff --git a/tradecalc.py b/tradecalc.py index 04b49a68..723c83d0 100644 --- a/tradecalc.py +++ b/tradecalc.py @@ -412,6 +412,14 @@ def getBestHops(self, routes, restrictTo=None): bestToDest = {} safetyMargin = 1.0 - tdenv.margin unique = tdenv.unique + + stationsNotYetLoaded = [ + src.ID for src in [ route.route[-1] for route in routes ] + if src.tradingWith is None + ] + if stationsNotYetLoaded: + self.tdb.loadStationTrades(stationsNotYetLoaded) + for route in routes: tdenv.DEBUG1("Route = {}", route.str())