diff options
author | SChernykh <sergey.v.chernykh@gmail.com> | 2020-10-20 14:16:09 +0200 |
---|---|---|
committer | SChernykh <sergey.v.chernykh@gmail.com> | 2020-10-20 14:16:09 +0200 |
commit | a25bc71f3faf3f7ca4de9eda6342503768bf28ad (patch) | |
tree | 9493846d8297b373769161737fac91f17bb5dcbc /src/cryptonote_core/blockchain.h | |
parent | Merge pull request #6891 (diff) | |
download | monero-a25bc71f3faf3f7ca4de9eda6342503768bf28ad.tar.xz |
Make Blockchain::get_fee_quantization_mask() compile time
This also removes potential thread safety bug in that function.
Diffstat (limited to 'src/cryptonote_core/blockchain.h')
-rw-r--r-- | src/cryptonote_core/blockchain.h | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/src/cryptonote_core/blockchain.h b/src/cryptonote_core/blockchain.h index a9b7ca1da..a8e251c71 100644 --- a/src/cryptonote_core/blockchain.h +++ b/src/cryptonote_core/blockchain.h @@ -51,6 +51,7 @@ #include "string_tools.h" #include "rolling_median.h" #include "cryptonote_basic/cryptonote_basic.h" +#include "common/powerof.h" #include "common/util.h" #include "cryptonote_protocol/cryptonote_protocol_defs.h" #include "rpc/core_rpc_server_commands_defs.h" @@ -591,7 +592,10 @@ namespace cryptonote * * @return the fee quantized mask */ - static uint64_t get_fee_quantization_mask(); + static uint64_t get_fee_quantization_mask() + { + return tools::PowerOf<10, CRYPTONOTE_DISPLAY_DECIMAL_POINT - PER_KB_FEE_QUANTIZATION_DECIMALS>::Value; + } /** * @brief get dynamic per kB or byte fee for a given block weight |