Improve check that user supplied memo field is too long.
This commit is contained in:
parent
e79ded8a47
commit
6114cfe767
|
@ -3242,8 +3242,7 @@ Value z_sendmany(const Array& params, bool fHelp)
|
||||||
} else if (!IsHex(memo)) {
|
} else if (!IsHex(memo)) {
|
||||||
throw JSONRPCError(RPC_INVALID_PARAMETER, "Invalid parameter, expected memo data in hexadecimal format.");
|
throw JSONRPCError(RPC_INVALID_PARAMETER, "Invalid parameter, expected memo data in hexadecimal format.");
|
||||||
}
|
}
|
||||||
std::vector<unsigned char> vMemo = ParseHex(memo);
|
if (memo.length() > ZC_MEMO_SIZE*2) {
|
||||||
if (vMemo.size() > ZC_MEMO_SIZE) {
|
|
||||||
throw JSONRPCError(RPC_INVALID_PARAMETER, strprintf("Invalid parameter, size of memo is larger than maximum allowed %d", ZC_MEMO_SIZE ));
|
throw JSONRPCError(RPC_INVALID_PARAMETER, strprintf("Invalid parameter, size of memo is larger than maximum allowed %d", ZC_MEMO_SIZE ));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue