@@ -1163,6 +1163,7 @@ market_ticker database_api_impl::get_ticker( const string& base, const string& q
1163
1163
const fc::time_point_sec yesterday = fc::time_point_sec ( now.sec_since_epoch () - 86400 );
1164
1164
1165
1165
market_ticker result;
1166
+ result.time = now;
1166
1167
result.base = base;
1167
1168
result.quote = quote;
1168
1169
result.latest = 0 ;
@@ -1364,6 +1365,7 @@ vector<market_trade> database_api_impl::get_trade_history( const string& base,
1364
1365
start = fc::time_point_sec ( fc::time_point::now () );
1365
1366
1366
1367
uint32_t count = 0 ;
1368
+ uint32_t skipped = 0 ;
1367
1369
auto itr = history_idx.lower_bound ( hkey );
1368
1370
vector<market_trade> result;
1369
1371
@@ -1388,7 +1390,10 @@ vector<market_trade> database_api_impl::get_trade_history( const string& base,
1388
1390
trade.price = price_to_real ( itr->op .fill_price );
1389
1391
1390
1392
if ( itr->op .is_maker )
1393
+ {
1394
+ trade.sequence = -itr->key .sequence ;
1391
1395
trade.side1_account_id = itr->op .account_id ;
1396
+ }
1392
1397
else
1393
1398
trade.side2_account_id = itr->op .account_id ;
1394
1399
@@ -1398,7 +1403,10 @@ vector<market_trade> database_api_impl::get_trade_history( const string& base,
1398
1403
&& next_itr->time == itr->time && next_itr->op .is_maker != itr->op .is_maker )
1399
1404
{ // next_itr now could be the other direction // FIXME not 100% sure
1400
1405
if ( next_itr->op .is_maker )
1406
+ {
1407
+ trade.sequence = -next_itr->key .sequence ;
1401
1408
trade.side1_account_id = next_itr->op .account_id ;
1409
+ }
1402
1410
else
1403
1411
trade.side2_account_id = next_itr->op .account_id ;
1404
1412
// skip the other direction
@@ -1408,6 +1416,12 @@ vector<market_trade> database_api_impl::get_trade_history( const string& base,
1408
1416
result.push_back ( trade );
1409
1417
++count;
1410
1418
}
1419
+ else // should skip
1420
+ {
1421
+ // TODO refuse to execute if need to skip too many entries
1422
+ // ++skipped;
1423
+ // FC_ASSERT( skipped <= 200 );
1424
+ }
1411
1425
1412
1426
++itr;
1413
1427
}
0 commit comments