diff options
author | luigi1111 <luigi1111w@gmail.com> | 2021-10-17 23:23:15 -0500 |
---|---|---|
committer | luigi1111 <luigi1111w@gmail.com> | 2021-10-17 23:23:15 -0500 |
commit | 308e601966dacd57967ce03a01cfc8926e8b3306 (patch) | |
tree | a3f9fafe7c1903b3f47f9bd79408f9312c494be2 /src | |
parent | Merge pull request #7989 (diff) | |
parent | Fix precision of average_output_time (diff) | |
download | monero-308e601966dacd57967ce03a01cfc8926e8b3306.tar.xz |
Merge pull request #7799
76542ea Fix precision of average_output_time (j-berman)
Diffstat (limited to 'src')
-rw-r--r-- | src/wallet/wallet2.cpp | 8 |
1 files changed, 1 insertions, 7 deletions
diff --git a/src/wallet/wallet2.cpp b/src/wallet/wallet2.cpp index 3b59267b2..22f71c49f 100644 --- a/src/wallet/wallet2.cpp +++ b/src/wallet/wallet2.cpp @@ -1024,13 +1024,7 @@ gamma_picker::gamma_picker(const std::vector<uint64_t> &rct_offsets, double shap end = rct_offsets.data() + rct_offsets.size() - CRYPTONOTE_DEFAULT_TX_SPENDABLE_AGE; num_rct_outputs = *(end - 1); THROW_WALLET_EXCEPTION_IF(num_rct_outputs == 0, error::wallet_internal_error, "No rct outputs"); - THROW_WALLET_EXCEPTION_IF(outputs_to_consider == 0, error::wallet_internal_error, "No rct outputs to consider"); - average_output_time = DIFFICULTY_TARGET_V2 * blocks_to_consider / outputs_to_consider; // this assumes constant target over the whole rct range - if (average_output_time == 0) { - // TODO: apply this to all cases; do so alongside a hard fork, where all clients will update at the same time, preventing anonymity puddle formation - average_output_time = DIFFICULTY_TARGET_V2 * blocks_to_consider / static_cast<double>(outputs_to_consider); - } - THROW_WALLET_EXCEPTION_IF(average_output_time == 0, error::wallet_internal_error, "Average seconds per output cannot be 0."); + average_output_time = DIFFICULTY_TARGET_V2 * blocks_to_consider / static_cast<double>(outputs_to_consider); // this assumes constant target over the whole rct range }; gamma_picker::gamma_picker(const std::vector<uint64_t> &rct_offsets): gamma_picker(rct_offsets, GAMMA_SHAPE, GAMMA_SCALE) {} |