Skip to content

Commit 8a4a2e4

Browse files
committed
Populate get_product RPC response from the secondary network if the
primary is unavailable.
1 parent 96e26ac commit 8a4a2e4

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
@@ -339,6 +339,13 @@ void user::parse_get_product( uint32_t tok, uint32_t itok )
339339
pub_key pkey;
340340
pkey.init_from_text( jp_.get_str( ntok ) );
341341
product *prod = sptr_->get_product( pkey );
342+
343+
// If the product is not present in the primary manager's mapping,
344+
// attempt to use the one in the secondary manager's mapping instead.
345+
if ( PC_UNLIKELY( !prod && sptr_->has_secondary() ) ) {
346+
prod = sptr_->get_secondary()->get_product( pkey );
347+
}
348+
342349
if ( PC_UNLIKELY( !prod ) )
343350
return add_unknown_symbol( itok );
344351

0 commit comments

Comments
 (0)