mirror of
https://github.com/bisq-network/bisq.git
synced 2025-02-23 06:55:08 +01:00
Correctly map lastRequest timestamp
The lastRequest timestamp is changed to show the last request to a pricenode. The previous approach of using the "last provider request timestamp" does not make sense in the new setup. Each currency rate is based on rates from several providers, each with their own "request timestamps". In addition, the pricenode returns the timestamp each rate was calculated. On top of that comes the timestamp when the Bisq node queries the pricenode. Since what is most relevant for the Bisq node is the "freshness" of a specific rate, the timestamp most indicative of that is the moment when the pricenode is queried.
This commit is contained in:
parent
b8a76b0e92
commit
189431ed7e
1 changed files with 6 additions and 1 deletions
|
@ -400,7 +400,12 @@ public class PriceFeedService {
|
|||
UserThread.execute(() -> {
|
||||
checkNotNull(result, "Result must not be null at requestAllPrices");
|
||||
timeStampMap = result.first;
|
||||
epochInSecondAtLastRequest = timeStampMap.get("btcAverageTs");
|
||||
|
||||
// Each currency rate has a different timestamp, depending on when
|
||||
// the pricenode aggregate rate was calculated
|
||||
// However, the request timestamp is when the pricenode was queried
|
||||
epochInSecondAtLastRequest = System.currentTimeMillis() / 1000L;
|
||||
|
||||
final Map<String, MarketPrice> priceMap = result.second;
|
||||
|
||||
cache.putAll(priceMap);
|
||||
|
|
Loading…
Add table
Reference in a new issue