This improves the handling of INVALID in IsMine:
- Extra INVALID conditions were added to
IsMine(following https://github.com/bitcoin/bitcoin/pull/13142/files#r185349057), but these were untested. Add unit tests for them. - In #13142 (comment) it was suggested to merge
isInvalidinto the return status. This PR takes a different approach, and removes theisInvalidentirely. It was only ever used inside tests, as normal users of IsMine don't care about the reason for non-mine-ness, only whether it is or not. As the unit tests are extensive enough, it seems sufficient to have a black box text (with tests for both compressed and uncompressed keys).
Some addition code simplification is done as well.