From 504dc12b64c69995041139c308918747fed7b73f Mon Sep 17 00:00:00 2001 From: Tom Pointon Date: Tue, 13 Sep 2022 14:29:32 +0000 Subject: [PATCH] Check to see if price account exists in either network when handling subscribe_price_sched --- pc/user.cpp | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/pc/user.cpp b/pc/user.cpp index 4e0622661..331209273 100644 --- a/pc/user.cpp +++ b/pc/user.cpp @@ -273,7 +273,12 @@ void user::parse_sub_price_sched( uint32_t tok, uint32_t itok ) if ( 0 == (ntok = jp_.find_val( ptok, "account" ) ) ) break; pub_key pkey; pkey.init_from_text( jp_.get_str( ntok ) ); + + // Check to see if the price exists in either the primary or the secondary manager price *sptr = sptr_->get_price( pkey ); + if ( !sptr && sptr_->has_secondary() ) { + sptr = sptr_->get_secondary()->get_price( pkey ); + }; if ( PC_UNLIKELY( !sptr ) ) { add_unknown_symbol(itok); return; } // add subscription