File tree Expand file tree Collapse file tree 1 file changed +4
-1
lines changed Expand file tree Collapse file tree 1 file changed +4
-1
lines changed Original file line number Diff line number Diff line change @@ -729,6 +729,7 @@ bool price::send( price *prices[], const unsigned n )
729729
730730 manager *mgr1 = nullptr ;
731731
732+ // Build an upd_price rpc request for every price
732733 for ( unsigned i = 0 , j = 0 ; i < n; ++i ) {
733734 price *const p = prices[ i ];
734735 if ( PC_UNLIKELY ( ! p->init_ && ! p->init_publish () ) ) {
@@ -772,6 +773,8 @@ bool price::send( price *prices[], const unsigned n )
772773 p->preq_ ->set_block_hash ( mgr->get_recent_block_hash () );
773774 upds_.emplace_back ( p->preq_ );
774775
776+ // If the batch is full, or we have reached the end, send the upd_price requests in upds_.
777+ // These correspond to the valid prices[j..i], inclusive.
775778 if (
776779 upds_.size () >= mgr->get_max_batch_size ()
777780 || ( upds_.size () && ( i + 1 ) == n )
@@ -823,7 +826,7 @@ bool price::send( price *prices[], const unsigned n )
823826 p1->inc_sent ();
824827 }
825828
826- j = i;
829+ j = i + 1 ;
827830 upds_.clear ();
828831 }
829832 }
You can’t perform that action at this time.
0 commit comments