From de32dcea1dc055813f875df63e47f2622ea5b709 Mon Sep 17 00:00:00 2001 From: italocoin Date: Sat, 9 Feb 2019 14:17:27 -0500 Subject: Human readable message if maximum outputs reached --- src/cryptonote_basic/cryptonote_format_utils.cpp | 1 + 1 file changed, 1 insertion(+) (limited to 'src') diff --git a/src/cryptonote_basic/cryptonote_format_utils.cpp b/src/cryptonote_basic/cryptonote_format_utils.cpp index f6daaab95..bb1d9daf2 100644 --- a/src/cryptonote_basic/cryptonote_format_utils.cpp +++ b/src/cryptonote_basic/cryptonote_format_utils.cpp @@ -389,6 +389,7 @@ namespace cryptonote for (const auto &bp: rv.p.bulletproofs) nlr += bp.L.size() * 2; const size_t bp_size = 32 * (9 + nlr); + CHECK_AND_ASSERT_THROW_MES_L1(n_outputs <= BULLETPROOF_MAX_OUTPUTS, "maximum number of outputs is " + std::to_string(BULLETPROOF_MAX_OUTPUTS) + " per transaction"); CHECK_AND_ASSERT_THROW_MES_L1(bp_base * n_padded_outputs >= bp_size, "Invalid bulletproof clawback"); const uint64_t bp_clawback = (bp_base * n_padded_outputs - bp_size) * 4 / 5; CHECK_AND_ASSERT_THROW_MES_L1(bp_clawback <= std::numeric_limits::max() - blob_size, "Weight overflow"); -- cgit v1.2.3