Sanity checking for coinstake inputs and checkwallet/repairwallet refactoring