I was doing my homework and came across this sentence in my textbook:
If you had needed money, you could have asked him.
Does that sentence mean the same as “if you needed money, you could have asked him.”? I'm having a hard time understanding the construction of the first sentence. What is the “had” for? Are the sentences implying the same thing or is there a slight difference between them?