parent
3c6f4ce223
commit
f1cd2c2454
3 changed files with 12 additions and 1 deletions
|
|
@ -434,7 +434,12 @@ void database::update_expired_feeds()
|
|||
assert( a.is_market_issued() );
|
||||
|
||||
const asset_bitasset_data_object& b = a.bitasset_data(*this);
|
||||
if( b.feed_is_expired(head_block_time()) )
|
||||
bool feed_is_expired;
|
||||
if( head_block_time() < HARDFORK_615_TIME )
|
||||
feed_is_expired = b.feed_is_expired_before_hardfork_615( head_block_time() );
|
||||
else
|
||||
feed_is_expired = b.feed_is_expired( head_block_time() );
|
||||
if( feed_is_expired )
|
||||
{
|
||||
modify(b, [this](asset_bitasset_data_object& a) {
|
||||
a.update_median_feeds(head_block_time());
|
||||
|
|
|
|||
4
libraries/chain/hardfork.d/615.hf
Normal file
4
libraries/chain/hardfork.d/615.hf
Normal file
|
|
@ -0,0 +1,4 @@
|
|||
// #615 Fix price feed expiration check, so websocket server will never spam too much data
|
||||
#ifndef HARDFORK_615_TIME
|
||||
#define HARDFORK_615_TIME (fc::time_point_sec( 1457550000 ))
|
||||
#endif
|
||||
|
|
@ -211,6 +211,8 @@ namespace graphene { namespace chain {
|
|||
|
||||
time_point_sec feed_expiration_time()const
|
||||
{ return current_feed_publication_time + options.feed_lifetime_sec; }
|
||||
bool feed_is_expired_before_hardfork_615(time_point_sec current_time)const
|
||||
{ return feed_expiration_time() >= current_time; }
|
||||
bool feed_is_expired(time_point_sec current_time)const
|
||||
{ return feed_expiration_time() <= current_time; }
|
||||
void update_median_feeds(time_point_sec current_time);
|
||||
|
|
|
|||
Loading…
Reference in a new issue