refactor: Make CFeeRate(integral) ctor constexpr

This is required for the next commit.

Also, in a test, use `inline constexpr` for an `auto` type, which is
also needed for the next commit, which hard-codes a list of types for
conversion.
This commit is contained in:
MarcoFalke
2026-07-31 10:30:05 +02:00
parent 5555d5dcb5
commit faedb52583
2 changed files with 2 additions and 2 deletions

View File

@@ -38,7 +38,7 @@ public:
/** Fee rate of 0 satoshis per 0 vB */
CFeeRate() = default;
template<std::integral I> // Disallow silent float -> int conversion
explicit CFeeRate(const I m_feerate_kvb) : m_feerate(FeePerVSize(m_feerate_kvb, 1000)) {}
explicit constexpr CFeeRate(const I m_feerate_kvb) : m_feerate(FeePerVSize(m_feerate_kvb, 1000)) {}
/**
* Construct a fee rate from a fee in satoshis and a vsize in vB.

View File

@@ -17,7 +17,7 @@
#include <univalue.h>
const auto NoMalleation = [](AutoFile& file, node::SnapshotMetadata& meta){};
inline constexpr auto NoMalleation = [](AutoFile& file, node::SnapshotMetadata& meta){};
/**
* Create and activate a UTXO snapshot, optionally providing a function to