Merge pull request #5461

aa768f1 signrawtransaction: validate private key. (Pavel Janík)
This commit is contained in:
Wladimir J. van der Laan 2014-12-12 11:51:23 +01:00
commit 5f7279ac70
No known key found for this signature in database
GPG key ID: 74810B012346C9A6

View file

@ -587,6 +587,8 @@ Value signrawtransaction(const Array& params, bool fHelp)
if (!fGood)
throw JSONRPCError(RPC_INVALID_ADDRESS_OR_KEY, "Invalid private key");
CKey key = vchSecret.GetKey();
if (!key.IsValid())
throw JSONRPCError(RPC_INVALID_ADDRESS_OR_KEY, "Private key outside allowed range");
tempKeystore.AddKey(key);
}
}