Skip to content

Commit 881b633

Browse files
authored
Fix spurious too many unacked price update transactions message (#274)
* Only add one pending update per batch transaction * Log the correct signature and pub_slot for batched updates
1 parent b18c201 commit 881b633

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

pc/request.cpp

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -815,20 +815,20 @@ bool price::send( price *prices[], const unsigned n )
815815
}
816816
else {
817817
p->get_rpc_client()->send( &upds_[ 0 ], upds_.size(), mgr->get_requested_upd_price_cu_units(), mgr->get_requested_upd_price_cu_price() );
818+
p->tvec_.emplace_back(
819+
std::string( 100, '\0' ), p->preq_->get_sent_time()
820+
);
821+
p->preq_->get_signature()->enc_base58( p->tvec_.back().first );
818822
for ( unsigned k = j; k <= i; ++k ) {
819823
price *const p1 = prices[ k ];
820-
p1->tvec_.emplace_back(
821-
std::string( 100, '\0' ), p1->preq_->get_sent_time()
822-
);
823-
p1->preq_->get_signature()->enc_base58( p1->tvec_.back().first );
824824
PC_LOG_DBG( "sent price update" )
825825
.add( "secondary", mgr->get_is_secondary() )
826826
.add( "price_account", *p1->get_account() )
827827
.add( "product_account", *p1->prod_->get_account() )
828828
.add( "symbol", p1->get_symbol() )
829829
.add( "price_type", price_type_to_str( p1->get_price_type() ) )
830-
.add( "sig", p1->tvec_.back().first )
831-
.add( "pub_slot", p1->preq_->get_slot() )
830+
.add( "sig", p->tvec_.back().first )
831+
.add( "pub_slot", p->preq_->get_slot() )
832832
.end();
833833
if ( PC_UNLIKELY( p1->tvec_.size() >= 100 ) ) {
834834
PC_LOG_WRN( "too many unacked price update transactions" )

0 commit comments

Comments
 (0)