Return error when importmulti called with invalid address.

Lack of error checking noticed by Alex Morcos <morcos@chaincode.com>
This commit is contained in:
Russell Yanofsky
2017-02-13 17:54:51 -05:00
parent d978c41e1e
commit 9acf25cc01
2 changed files with 13 additions and 0 deletions

View File

@@ -671,6 +671,9 @@ UniValue processImport(const UniValue& data) {
if (!isScript) {
address = CBitcoinAddress(output);
if (!address.IsValid()) {
throw JSONRPCError(RPC_INVALID_ADDRESS_OR_KEY, "Invalid address");
}
script = GetScriptForDestination(address.Get());
} else {
if (!IsHex(output)) {