diff options
| author | Ross Nicoll <[email protected]> | 2021-06-16 22:54:30 +0100 |
|---|---|---|
| committer | Ross Nicoll <[email protected]> | 2021-07-09 22:06:26 +0100 |
| commit | 72bc180795b62cf29433635521ec86c803b46c08 (patch) | |
| tree | 8998a330564d22924d47bba98f891fecbe67e835 /src/init.cpp | |
| parent | Rewrite subsidy limit tests (diff) | |
| download | discoin-72bc180795b62cf29433635521ec86c803b46c08.tar.xz discoin-72bc180795b62cf29433635521ec86c803b46c08.zip | |
Cap maximum fee
Cap maximum fee at 21 million Dogecoins to ensure there is no overflow in the fee logic.
Diffstat (limited to 'src/init.cpp')
| -rw-r--r-- | src/init.cpp | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/src/init.cpp b/src/init.cpp index 36b82c243..b38f192c1 100644 --- a/src/init.cpp +++ b/src/init.cpp @@ -1118,6 +1118,8 @@ bool AppInitParameterInteraction(const ArgsManager& args) CAmount n = 0; if (!ParseMoney(args.GetArg("-incrementalrelayfee", ""), n)) return InitError(AmountErrMsg("incrementalrelayfee", args.GetArg("-incrementalrelayfee", ""))); + if (n > MAX_FEE_RATE) + return InitError(strprintf(Untranslated("-incrementalrelayfee is greater than maximum fee rate of %ld."), MAX_FEE_RATE)); incrementalRelayFee = CFeeRate(n); } @@ -1154,6 +1156,8 @@ bool AppInitParameterInteraction(const ArgsManager& args) if (!ParseMoney(args.GetArg("-minrelaytxfee", ""), n)) { return InitError(AmountErrMsg("minrelaytxfee", args.GetArg("-minrelaytxfee", ""))); } + if (n > MAX_FEE_RATE) + return InitError(strprintf(Untranslated("-minrelaytxfee is greater than maximum fee rate of %ld."), MAX_FEE_RATE)); // High fee check is done afterward in CWallet::Create() ::minRelayTxFee = CFeeRate(n); } else if (incrementalRelayFee > ::minRelayTxFee) { @@ -1176,6 +1180,8 @@ bool AppInitParameterInteraction(const ArgsManager& args) CAmount n = 0; if (!ParseMoney(args.GetArg("-dustrelayfee", ""), n)) return InitError(AmountErrMsg("dustrelayfee", args.GetArg("-dustrelayfee", ""))); + if (n > MAX_FEE_RATE) + return InitError(strprintf(Untranslated("-dustrelayfee is greater than maximum fee rate of %ld."), MAX_FEE_RATE)); dustRelayFee = CFeeRate(n); } |