Skip to content

Commit 41a529e

Browse files
authored
Check to see if price account exists in either network when handling subscribe_price_sched (#292)
1 parent 8301f05 commit 41a529e

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

pc/user.cpp

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -273,7 +273,12 @@ void user::parse_sub_price_sched( uint32_t tok, uint32_t itok )
273273
if ( 0 == (ntok = jp_.find_val( ptok, "account" ) ) ) break;
274274
pub_key pkey;
275275
pkey.init_from_text( jp_.get_str( ntok ) );
276+
277+
// Check to see if the price exists in either the primary or the secondary manager
276278
price *sptr = sptr_->get_price( pkey );
279+
if ( !sptr && sptr_->has_secondary() ) {
280+
sptr = sptr_->get_secondary()->get_price( pkey );
281+
};
277282
if ( PC_UNLIKELY( !sptr ) ) { add_unknown_symbol(itok); return; }
278283

279284
// add subscription

0 commit comments

Comments
 (0)