Skip to content

Commit 39c9f30

Browse files
committed
Check to see if price account exists in either network when handling subscribe_price
1 parent 504dc12 commit 39c9f30

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

pc/user.cpp

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -243,7 +243,13 @@ void user::parse_sub_price( uint32_t tok, uint32_t itok )
243243
if ( 0 == (ntok = jp_.find_val( ptok, "account" ) ) ) break;
244244
pub_key pkey;
245245
pkey.init_from_text( jp_.get_str( ntok ) );
246+
247+
// Check to see if the price exists in either the primary or the secondary manager
246248
price *sptr = sptr_->get_price( pkey );
249+
if ( !sptr && sptr_->has_secondary() ) {
250+
sptr = sptr_->get_secondary()->get_price( pkey );
251+
};
252+
247253
if ( PC_UNLIKELY( !sptr ) ) { add_unknown_symbol(itok); return; }
248254

249255
// add subscription

0 commit comments

Comments
 (0)