Уважаемые пользователи Голос!
Сайт доступен в режиме «чтение» до сентября 2020 года. Операции с токенами Golos, Cyber можно проводить, используя альтернативные клиенты или через эксплорер Cyberway. Подробности здесь: https://golos.io/@goloscore/operacii-s-tokenami-golos-cyber-1594822432061
С уважением, команда “Голос”
GOLOS
RU
EN
UA
gtg
7 лет назад

Witness price feed never expire?

During today's talks about expired (?) price feeds I realized that Golos might be prone to the same issue we had on Steem which caused that outdated feeds wasn't actually expired (https://github.com/steemit/steem/issues/822).

Golos

Code:

const witness_schedule_object &wso = get_witness_schedule_object();
vector <price> feeds;
feeds.reserve(wso.num_scheduled_witnesses);
for (int i = 0; i < wso.num_scheduled_witnesses; i++) {
    const auto &wit = get_witness(wso.current_shuffled_witnesses[i]);
    if (wit.last_sbd_exchange_update < now + STEEMIT_MAX_FEED_AGE && !wit.sbd_exchange_rate.is_null()) {
        feeds.push_back(wit.sbd_exchange_rate);
    }
}

As stated in the original issue:

"Once a witness published a price feed, wit.last_sbd_exchange_update < now + STEEMIT_MAX_FEED_AGE will always be true and !wit.sbd_exchange_rate.is_null() will always be true, thus the price feed will never expire."

The fix should be as simple as replacing:
wit.last_sbd_exchange_update < now + STEEMIT_MAX_FEED_AGE && !wit.sbd_exchange_rate.is_null()
with
now < wit.last_sbd_exchange_update + STEEMIT_MAX_FEED_AGE && !wit.sbd_exchange_rate.is_null()
of course while keeping in mind the hardfork logic (i.e. if has_hardfork etc.)

Submitted GitHub issue.

HTH, GtG :-)



I hope that my experience from Steem can be of value on Golos.
If you think the same, please vote for me as a witness, every vote counts.
My Golos seed node, golos.rushub.ru is up and running, listening at port 4243.
You can contact me directly at chat.golos.io as Gandalf.

0
260.590 GOLOS
Комментарии (10)
Сортировать по:
Сначала старые