bitcoin/bitcoin — pull request #1084 by dooglus (2012-04-12 20:20:39+00:00)
Title: importprivkey doesn't check that it is given a private key

I just accidentally ran:

bitcoind importprivkey 1HV9Lc3sNHZxwj4Zk6fB38tEmBryq2cBiF

passing an address instead of a private key, and it didn't complain.

I ended up with a new key in my wallet with a potentially publicly known private key.

This pull request adds a call of IsValid() to CBitcoinSecret's SetString() function to ensure that the private key at least has the correct version.