PR comments

This commit is contained in:
j-berman 2023-04-19 12:25:43 -07:00
parent 945abfd57d
commit 2154374ae2

View file

@ -68,7 +68,8 @@ namespace lws
bool gamma_picker::is_valid() const noexcept
{
return CRYPTONOTE_DEFAULT_TX_SPENDABLE_AGE < rct_offsets.size() + 1;
static_assert(CRYPTONOTE_DEFAULT_TX_SPENDABLE_AGE > 0);
return CRYPTONOTE_DEFAULT_TX_SPENDABLE_AGE - 1 < rct_offsets.size();
}
std::uint64_t gamma_picker::spendable_upper_bound() const noexcept
@ -91,6 +92,7 @@ namespace lws
static_assert(std::is_empty<crypto::random_device>(), "random_device is no longer cheap to construct");
static constexpr const crypto::random_device engine{};
static_assert(CRYPTONOTE_DEFAULT_TX_SPENDABLE_AGE > 0);
const auto end = offsets().end() - CRYPTONOTE_DEFAULT_TX_SPENDABLE_AGE + 1;
const uint64_t num_rct_outputs = spendable_upper_bound();