mirror of
https://github.com/ElementsProject/elements.git
synced 2026-08-14 12:43:40 +02:00
Disallow implicit conversion for CFeeRate constructor
This commit is contained in:
parent
36fceda4ab
commit
130d190e70
2 changed files with 2 additions and 2 deletions
|
|
@ -25,7 +25,7 @@ public:
|
|||
/** Fee rate of 0 satoshis per kB */
|
||||
CFeeRate() : nSatoshisPerK(0) { }
|
||||
template<typename I>
|
||||
CFeeRate(const I _nSatoshisPerK): nSatoshisPerK(_nSatoshisPerK) {
|
||||
explicit CFeeRate(const I _nSatoshisPerK): nSatoshisPerK(_nSatoshisPerK) {
|
||||
// We've previously had bugs creep in from silent double->int conversion...
|
||||
static_assert(std::is_integral<I>::value, "CFeeRate should be used without floats");
|
||||
}
|
||||
|
|
|
|||
|
|
@ -2625,7 +2625,7 @@ static UniValue settxfee(const JSONRPCRequest& request)
|
|||
|
||||
CAmount nAmount = AmountFromValue(request.params[0]);
|
||||
CFeeRate tx_fee_rate(nAmount, 1000);
|
||||
if (tx_fee_rate == 0) {
|
||||
if (tx_fee_rate == CFeeRate(0)) {
|
||||
// automatic selection
|
||||
} else if (tx_fee_rate < ::minRelayTxFee) {
|
||||
throw JSONRPCError(RPC_INVALID_PARAMETER, strprintf("txfee cannot be less than min relay tx fee (%s)", ::minRelayTxFee.ToString()));
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue