Skip to content

Commit 0750966

Browse files
committed
Populate get_product RPC response from the secondary network if the
primary is unavailable.
1 parent ed8009a commit 0750966

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

pc/user.cpp

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -343,6 +343,13 @@ void user::parse_get_product( uint32_t tok, uint32_t itok )
343343
pub_key pkey;
344344
pkey.init_from_text( jp_.get_str( ntok ) );
345345
product *prod = sptr_->get_product( pkey );
346+
347+
// If the product is not present in the primary manager's mapping,
348+
// attempt to use the one in the secondary manager's mapping instead.
349+
if ( PC_UNLIKELY( !prod && sptr_->has_secondary() ) ) {
350+
prod = sptr_->get_secondary()->get_product( pkey );
351+
}
352+
346353
if ( PC_UNLIKELY( !prod ) )
347354
return add_unknown_symbol( itok );
348355

0 commit comments

Comments
 (0)