signrawtransaction: validate private key.

This commit is contained in:
Pavel Janík 2014-12-11 16:06:23 +01:00
parent 41cced2106
commit aa768f1848
1 changed files with 2 additions and 0 deletions

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);
}
}