-
Notifications
You must be signed in to change notification settings - Fork 37.8k
util: Add [[nodiscard]] to all {Decode,Parse}[...](...) functions returning bool #13815
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
7c5bc2a
145fe95
579497e
9cc0230
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -95,6 +95,7 @@ endif | |
BITCOIN_CORE_H = \ | ||
addrdb.h \ | ||
addrman.h \ | ||
attributes.h \ | ||
base58.h \ | ||
bech32.h \ | ||
bloom.h \ | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
// Copyright (c) 2009-2010 Satoshi Nakamoto | ||
// Copyright (c) 2009-2018 The Bitcoin Core developers | ||
// Distributed under the MIT software license, see the accompanying | ||
// file COPYING or http://www.opensource.org/licenses/mit-license.php. | ||
|
||
#ifndef BITCOIN_ATTRIBUTES_H | ||
#define BITCOIN_ATTRIBUTES_H | ||
|
||
#if defined(__has_cpp_attribute) | ||
# if __has_cpp_attribute(nodiscard) | ||
practicalswift marked this conversation as resolved.
Show resolved
Hide resolved
|
||
# define NODISCARD [[nodiscard]] | ||
# endif | ||
#endif | ||
#ifndef NODISCARD | ||
# if defined(_MSC_VER) && _MSC_VER >= 1700 | ||
# define NODISCARD _Check_return_ | ||
# else | ||
# define NODISCARD __attribute__((warn_unused_result)) | ||
# endif | ||
#endif | ||
|
||
practicalswift marked this conversation as resolved.
Show resolved
Hide resolved
|
||
#endif // BITCOIN_ATTRIBUTES_H |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -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)) { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. with this change the scope of variable
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @arvidn We allow only C++11 :-) |
||
options.blockMinFeeRate = CFeeRate(n); | ||
} else { | ||
options.blockMinFeeRate = CFeeRate(DEFAULT_BLOCK_MIN_TX_FEE); | ||
|
Uh oh!
There was an error while loading. Please reload this page.