Lloyd John Ogilvie said this quote

The fallacy in Peter's mind was this: he believed his relationship was dependent on his consistency in producing the qualities he thought had earned him the Lord's approval.