Improve check that user supplied memo field is too long.

This commit is contained in:
Simon 2016-09-08 20:46:39 -07:00
parent e79ded8a47
commit 6114cfe767
1 changed files with 1 additions and 2 deletions

View File

@ -3242,8 +3242,7 @@ Value z_sendmany(const Array& params, bool fHelp)
} else if (!IsHex(memo)) {
throw JSONRPCError(RPC_INVALID_PARAMETER, "Invalid parameter, expected memo data in hexadecimal format.");
}
std::vector<unsigned char> vMemo = ParseHex(memo);
if (vMemo.size() > ZC_MEMO_SIZE) {
if (memo.length() > ZC_MEMO_SIZE*2) {
throw JSONRPCError(RPC_INVALID_PARAMETER, strprintf("Invalid parameter, size of memo is larger than maximum allowed %d", ZC_MEMO_SIZE ));
}
}