Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 12 additions & 0 deletions configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -469,6 +469,10 @@ if test "x$enable_werror" = "xyes"; then
AX_CHECK_COMPILE_FLAG([-Werror=unreachable-code-loop-increment],[ERROR_CXXFLAGS="$ERROR_CXXFLAGS -Werror=unreachable-code-loop-increment"],,[[$CXXFLAG_WERROR]])
AX_CHECK_COMPILE_FLAG([-Werror=mismatched-tags], [ERROR_CXXFLAGS="$ERROR_CXXFLAGS -Werror=mismatched-tags"], [], [$CXXFLAG_WERROR])
AX_CHECK_COMPILE_FLAG([-Werror=implicit-fallthrough], [ERROR_CXXFLAGS="$ERROR_CXXFLAGS -Werror=implicit-fallthrough"], [], [$CXXFLAG_WERROR])

if test x$suppress_external_warnings != xno ; then
AX_CHECK_COMPILE_FLAG([-Werror=documentation],[ERROR_CXXFLAGS="$ERROR_CXXFLAGS -Werror=documentation"],,[[$CXXFLAG_WERROR]])
fi
fi

if test "x$CXXFLAGS_overridden" = "xno"; then
Expand All @@ -494,6 +498,10 @@ if test "x$CXXFLAGS_overridden" = "xno"; then
AX_CHECK_COMPILE_FLAG([-Wunreachable-code-loop-increment],[WARN_CXXFLAGS="$WARN_CXXFLAGS -Wunreachable-code-loop-increment"],,[[$CXXFLAG_WERROR]])
AX_CHECK_COMPILE_FLAG([-Wimplicit-fallthrough], [WARN_CXXFLAGS="$WARN_CXXFLAGS -Wimplicit-fallthrough"], [], [$CXXFLAG_WERROR])

if test x$suppress_external_warnings != xno ; then
AX_CHECK_COMPILE_FLAG([-Wdocumentation],[WARN_CXXFLAGS="$WARN_CXXFLAGS -Wdocumentation"],,[[$CXXFLAG_WERROR]])
fi

dnl Some compilers (gcc) ignore unknown -Wno-* options, but warn about all
dnl unknown options if any other warning is produced. Test the -Wfoo case, and
dnl set the -Wno-foo case if it works.
Expand Down Expand Up @@ -1527,6 +1535,10 @@ if test x$build_bitcoin_cli$build_bitcoind$bitcoin_enable_qt$use_tests$use_bench
if test x$TARGET_OS != xwindows; then
PKG_CHECK_MODULES([EVENT_PTHREADS], [libevent_pthreads >= 2.0.21],, [AC_MSG_ERROR([libevent_pthreads version 2.0.21 or greater not found.])])
fi

if test x$suppress_external_warnings != xno; then
EVENT_CFLAGS=SUPPRESS_WARNINGS($EVENT_CFLAGS)
fi
fi

if test x$use_libevent = xyes; then
Expand Down
8 changes: 4 additions & 4 deletions src/Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -37,8 +37,8 @@ endif
endif #ENABLE_STACKTRACES

BITCOIN_INCLUDES=-I$(builddir) -I$(srcdir)/secp256k1/include -I$(srcdir)/$(UNIVALUE_INCLUDE_DIR_INT) $(BDB_CPPFLAGS) $(BOOST_CPPFLAGS) $(LEVELDB_CPPFLAGS)
BITCOIN_INCLUDES+=-I$(srcdir)/dashbls/include -I$(srcdir)/dashbls/depends/relic/include -I$(srcdir)/dashbls/depends/minialloc/include
BITCOIN_INCLUDES+=-I$(srcdir)/immer
BITCOIN_INCLUDES+=-isystem$(srcdir)/dashbls/include -isystem$(srcdir)/dashbls/depends/relic/include -isystem$(srcdir)/dashbls/depends/minialloc/include
BITCOIN_INCLUDES+=-isystem$(srcdir)/immer

LIBBITCOIN_SERVER=libbitcoin_server.a
LIBBITCOIN_COMMON=libbitcoin_common.a
Expand Down Expand Up @@ -921,8 +921,8 @@ libdashconsensus_la_SOURCES = support/cleanse.cpp $(crypto_libbitcoin_crypto_bas
libdashconsensus_la_LDFLAGS = $(AM_LDFLAGS) -no-undefined $(RELDFLAGS)
libdashconsensus_la_LIBADD = $(LIBDASHBLS) $(LIBSECP256K1) $(GMP_LIBS)
libdashconsensus_la_CPPFLAGS = $(AM_CPPFLAGS) -I$(builddir)/obj -I$(srcdir)/secp256k1/include -DBUILD_BITCOIN_INTERNAL
libdashconsensus_la_CPPFLAGS += -I$(srcdir)/dashbls/include -I$(srcdir)/dashbls/depends/relic/include -I$(srcdir)/dashbls/depends/minialloc/include
libdashconsensus_la_CPPFLAGS += -I$(srcdir)/immer
libdashconsensus_la_CPPFLAGS += -isystem$(srcdir)/dashbls/include -isystem$(srcdir)/dashbls/depends/relic/include -isystem$(srcdir)/dashbls/depends/minialloc/include
libdashconsensus_la_CPPFLAGS += -isystem$(srcdir)/immer
libdashconsensus_la_CXXFLAGS = $(AM_CXXFLAGS) $(PIE_FLAGS)

endif
Expand Down
2 changes: 1 addition & 1 deletion src/cxxtimer.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ class Timer {
/**
* Return the elapsed time.
*
* @param duration_t
* @tparam duration_t
* The duration type used to return the time elapsed. If not
* specified, it returns the time as represented by
* std::chrono::milliseconds.
Expand Down
2 changes: 1 addition & 1 deletion src/dbwrapper.h
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ class CDBBatch

public:
/**
* @param[in] parent CDBWrapper that this batch is to be submitted to
* @param[in] _parent CDBWrapper that this batch is to be submitted to
*/
explicit CDBBatch(const CDBWrapper &_parent) : parent(_parent), ssKey(SER_DISK, CLIENT_VERSION), ssValue(SER_DISK, CLIENT_VERSION), size_estimate(0) { };

Expand Down
9 changes: 0 additions & 9 deletions src/evo/deterministicmns.h
Original file line number Diff line number Diff line change
Expand Up @@ -346,23 +346,18 @@ class CDeterministicMNList
* Calculates the projected MN payees for the next *count* blocks. The result is not guaranteed to be correct
* as PoSe banning might occur later
* @param nCount the number of payees to return. "nCount = max()"" means "all", use it to avoid calling GetValidWeightedMNsCount twice.
* @return
*/
[[nodiscard]] std::vector<CDeterministicMNCPtr> GetProjectedMNPayees(gsl::not_null<const CBlockIndex* const> pindexPrev, int nCount = std::numeric_limits<int>::max()) const;

/**
* Calculate a quorum based on the modifier. The resulting list is deterministically sorted by score
* @param maxSize
* @param modifier
* @return
*/
[[nodiscard]] std::vector<CDeterministicMNCPtr> CalculateQuorum(size_t maxSize, const uint256& modifier, const bool onlyEvoNodes = false) const;
[[nodiscard]] std::vector<std::pair<arith_uint256, CDeterministicMNCPtr>> CalculateScores(const uint256& modifier, const bool onlyEvoNodes) const;

/**
* Calculates the maximum penalty which is allowed at the height of this MN list. It is dynamic and might change
* for every block.
* @return
*/
[[nodiscard]] int CalcMaxPoSePenalty() const;

Expand All @@ -371,17 +366,13 @@ class CDeterministicMNList
* value later passed to PoSePunish. The percentage should be high enough to take per-block penalty decreasing for MNs
* into account. This means, if you want to accept 2 failures per payment cycle, you should choose a percentage that
* is higher then 50%, e.g. 66%.
* @param percent
* @return
*/
[[nodiscard]] int CalcPenalty(int percent) const;

/**
* Punishes a MN for misbehavior. If the resulting penalty score of the MN reaches the max penalty, it is banned.
* Penalty scores are only increased when the MN is not already banned, which means that after banning the penalty
* might appear lower then the current max penalty, while the MN is still banned.
* @param proTxHash
* @param penalty
*/
void PoSePunish(const uint256& proTxHash, int penalty, bool debugLogs);

Expand Down
2 changes: 1 addition & 1 deletion src/net_processing.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2986,7 +2986,7 @@ void PeerManagerImpl::ProcessHeadersMessage(CNode& pfrom, const Peer& peer,
/**
* Reconsider orphan transactions after a parent has been accepted to the mempool.
*
* @param[in/out] orphan_work_set The set of orphan transactions to reconsider. Generally only one
* @param[in,out] orphan_work_set The set of orphan transactions to reconsider. Generally only one
* orphan will be reconsidered on each call of this function. This set
* may be added to if accepting an orphan causes its children to be
* reconsidered.
Expand Down
3 changes: 1 addition & 2 deletions src/netbase.h
Original file line number Diff line number Diff line change
Expand Up @@ -176,7 +176,6 @@ CService LookupNumeric(const std::string& name, uint16_t portDefault = 0, DNSLoo
* @param strSubnet A string representation of a subnet of the form `network
* address [ "/", ( CIDR-style suffix | netmask ) ]`(e.g.
* `2001:db8::/32`, `192.0.2.0/255.255.255.0`, or `8.8.8.8`).
* @param ret The resulting internal representation of a subnet.
*
* @returns Whether the operation succeeded or not.
*/
Expand Down Expand Up @@ -237,7 +236,7 @@ void InterruptSocks5(bool interrupt);
* @param port The destination port.
* @param auth The credentials with which to authenticate with the specified
* SOCKS5 proxy.
* @param sock The SOCKS5 proxy socket.
* @param socket The SOCKS5 proxy socket.
*
* @returns Whether or not the operation succeeded.
*
Expand Down
1 change: 0 additions & 1 deletion src/node/transaction.h
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,6 @@ static const CFeeRate DEFAULT_MAX_RAW_TX_FEE_RATE{COIN / 10};
* @param[in] node reference to node context
* @param[in] tx the transaction to broadcast
* @param[out] err_string reference to std::string to fill with error string if available
* @param[in] max_tx_fee reject txs with fees higher than this (if 0, accept any fee)
* @param[in] relay flag if both mempool insertion and p2p relay are requested
* @param[in] wait_callback wait until callbacks have been processed to avoid stale result due to a sequentially RPC.
* return error
Expand Down
3 changes: 1 addition & 2 deletions src/rpc/rawtransaction_util.h
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@ class SigningProvider;
* Sign a transaction with the given keystore and previous transactions
*
* @param mtx The transaction to-be-signed
* @param prevTxsUnival Array of previous txns outputs that tx depends on but may not yet be in the block chain
* @param keystore Temporary keystore containing signing keys
* @param coins Map of unspent outputs
* @param hashType The signature hash type
Expand All @@ -31,7 +30,7 @@ void SignTransactionResultToJSON(CMutableTransaction& mtx, bool complete, const
/**
* Parse a prevtxs UniValue array and get the map of coins from it
*
* @param prevTxs Array of previous txns outputs that tx depends on but may not yet be in the block chain
* @param prevTxsUnival Array of previous txns outputs that tx depends on but may not yet be in the block chain
* @param keystore A pointer to the temprorary keystore if there is one
* @param coins Map of unspent outputs - coins in mempool and current chain UTXO set, may be extended by previous txns outputs after call
*/
Expand Down
2 changes: 1 addition & 1 deletion src/util/enumerate.h
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
/**
* similar to python's enumerate(iterable).
* @tparam T type of iterable, automatically deduced
* @tparam TIter
* @tparam TIter begin of containter
* @param iterable an iterable object, can be a temporary
* @return struct containing a size_t index, and it's element in iterable
*/
Expand Down
2 changes: 1 addition & 1 deletion src/util/sock.h
Original file line number Diff line number Diff line change
Expand Up @@ -250,7 +250,7 @@ class Sock

/**
* Check if still connected.
* @param[out] err The error string, if the socket has been disconnected.
* @param[out] errmsg The error string, if the socket has been disconnected.
* @return true if connected
*/
[[nodiscard]] virtual bool IsConnected(std::string& errmsg) const;
Expand Down
3 changes: 1 addition & 2 deletions src/validation.h
Original file line number Diff line number Diff line change
Expand Up @@ -1099,7 +1099,6 @@ class ChainstateManager
* @param[out] state This may be set to an Error state if any error occurred processing them
* @param[in] chainparams The params for the chain we want to connect to
* @param[out] ppindex If set, the pointer will be set to point to the last new block index object for the given headers
* @param[out] first_invalid First header that fails validation, if one exists
*/
bool ProcessNewBlockHeaders(const std::vector<CBlockHeader>& block, BlockValidationState& state, const CChainParams& chainparams, const CBlockIndex** ppindex = nullptr) LOCKS_EXCLUDED(cs_main);

Expand Down Expand Up @@ -1153,7 +1152,7 @@ inline bool IsBlockPruned(const CBlockIndex* pblockindex)
/**
* Return the expected assumeutxo value for a given height, if one exists.
*
* @param height[in] Get the assumeutxo value for this height.
* @param[in] height Get the assumeutxo value for this height.
*
* @returns empty if no assumeutxo configuration exists for the given height.
*/
Expand Down
2 changes: 1 addition & 1 deletion src/wallet/scriptpubkeyman.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ bool HaveKeys(const std::vector<valtype>& pubkeys, const LegacyScriptPubKeyMan&
//! Recursively solve script and return spendable/watchonly/invalid status.
//!
//! @param keystore legacy key and script store
//! @param script script to solve
//! @param scriptPubKey script to solve
//! @param sigversion script type (top-level / redeemscript)
//! @param recurse_scripthash whether to recurse into nested p2sh
//! scripts or simply treat any script that has been
Expand Down
2 changes: 1 addition & 1 deletion src/wallet/scriptpubkeyman.h
Original file line number Diff line number Diff line change
Expand Up @@ -250,7 +250,7 @@ class LegacyScriptPubKeyMan : public ScriptPubKeyMan, public FillableSigningProv
CryptedKeyMap mapCryptedKeys GUARDED_BY(cs_KeyStore);
WatchOnlySet setWatchOnly GUARDED_BY(cs_KeyStore);
WatchKeyMap mapWatchKeys GUARDED_BY(cs_KeyStore);
HDPubKeyMap mapHdPubKeys GUARDED_BY(cs_KeyStore); //<! memory map of HD extended pubkeys
HDPubKeyMap mapHdPubKeys GUARDED_BY(cs_KeyStore); ///<! memory map of HD extended pubkeys

int64_t nTimeFirstKey GUARDED_BY(cs_KeyStore) = 0;

Expand Down
3 changes: 1 addition & 2 deletions src/wallet/wallet.h
Original file line number Diff line number Diff line change
Expand Up @@ -1408,7 +1408,7 @@ class CWallet final : public WalletStorage, public interfaces::Chain::Notificati
//! Returns all unique ScriptPubKeyMans
std::set<ScriptPubKeyMan*> GetAllScriptPubKeyMans() const;

//! Get the ScriptPubKeyMan for the given OutputType and internal/external chain.
//! Get the ScriptPubKeyMan for internal/external chain.
ScriptPubKeyMan* GetScriptPubKeyMan(bool internal) const;

//! Get the ScriptPubKeyMan for a script
Expand Down Expand Up @@ -1472,7 +1472,6 @@ class CWallet final : public WalletStorage, public interfaces::Chain::Notificati

//! Remove specified ScriptPubKeyMan from set of active SPK managers. Writes the change to the wallet file.
//! @param[in] id The unique id for the ScriptPubKeyMan
//! @param[in] type The OutputType this ScriptPubKeyMan provides addresses for
//! @param[in] internal Whether this ScriptPubKeyMan provides change addresses
void DeactivateScriptPubKeyMan(uint256 id, bool internal);

Expand Down