summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--db/replset.h10
1 files changed, 6 insertions, 4 deletions
diff --git a/db/replset.h b/db/replset.h
index 649f67b482b..8c03d690804 100644
--- a/db/replset.h
+++ b/db/replset.h
@@ -113,12 +113,14 @@ namespace mongo {
inline bool isMaster( const char *client = 0 ) {
if ( !client )
client = database->name.c_str();
- if ( replAllDead || slave ) {
+
+ if ( replAllDead )
return strcmp( client, "local" ) == 0;
- }
- if ( replPair == 0 || replPair->state == ReplPair::State_Master )
- return true;
+ if ( replPair ) {
+ if( replPair->state == ReplPair::State_Master )
+ return true;
+ }
return strcmp( client, "local" ) == 0;
}