This could all be one line:

if (seq && (seq <= mValidLedgerSeq || seq == mBuildingLedgerSeq))

Also - under what conditions is seq == 0?  (Just for my personal interest...)