diff options
author | MarcoFalke <falke.marco@gmail.com> | 2018-11-15 14:37:13 -0500 |
---|---|---|
committer | MarcoFalke <falke.marco@gmail.com> | 2018-11-15 14:39:37 -0500 |
commit | 384967f311b4c6b1d6c797f7821d25feb26bafbf (patch) | |
tree | df3976014e6aa21e7399492e4de1a30d7f1f793e /src/miner.cpp | |
parent | e74649e95122c9c61aadf607461cf701c3953f88 (diff) | |
parent | 9cc0230cfc1ae9b9c1c905cd9ac613bc98bfa43a (diff) |
Merge #13815: util: Add [[nodiscard]] to all {Decode,Parse}[...](...) functions returning bool
9cc0230cfc Add NODISCARD to all {Decode,Parse}[...](...) functions returning bool. Sort includes. (practicalswift)
579497e77a tests: Explicitly ignore the return value of DecodeBase58(...) (practicalswift)
145fe95ec7 tests: Check return value of ParseParameters(...) (practicalswift)
7c5bc2a523 miner: Default to DEFAULT_BLOCK_MIN_TX_FEE if unable to parse -blockmintxfee (practicalswift)
Pull request description:
Changes in this PR:
* ~~Add linter to make sure the return value of `Parse[...](...)` is checked~~
* Add `__attribute__((warn_unused_result))` to all `{Decode,Parse}[...](...)` functions returning `bool`
* Fix violations
Context:
* #13712: `wallet: Fix non-determinism in ParseHDKeypath(...). Avoid using an uninitialized variable in path calculation.` would have been prevented by this
Tree-SHA512: 41a97899f2d5a26584235fa02b1ebfb4faacd81ea97e927022955a658fa7e15d07a1443b4b7635151a43259a1adf8f2f4de3c1c75d7b5f09f0d5496463a1dae6
Diffstat (limited to 'src/miner.cpp')
-rw-r--r-- | src/miner.cpp | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/src/miner.cpp b/src/miner.cpp index feb86cab66..96c9cd6d2a 100644 --- a/src/miner.cpp +++ b/src/miner.cpp @@ -70,9 +70,8 @@ static BlockAssembler::Options DefaultOptions() // If -blockmaxweight is not given, limit to DEFAULT_BLOCK_MAX_WEIGHT BlockAssembler::Options options; options.nBlockMaxWeight = gArgs.GetArg("-blockmaxweight", DEFAULT_BLOCK_MAX_WEIGHT); - if (gArgs.IsArgSet("-blockmintxfee")) { - CAmount n = 0; - ParseMoney(gArgs.GetArg("-blockmintxfee", ""), n); + CAmount n = 0; + if (gArgs.IsArgSet("-blockmintxfee") && ParseMoney(gArgs.GetArg("-blockmintxfee", ""), n)) { options.blockMinFeeRate = CFeeRate(n); } else { options.blockMinFeeRate = CFeeRate(DEFAULT_BLOCK_MIN_TX_FEE); |