diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -232,6 +232,7 @@ -Wduplicated-branches -Wduplicated-cond -Wlogical-op + -Wdocumentation ) add_compiler_flag_group(-Wformat -Wformat-security) add_cxx_compiler_flags( diff --git a/src/cuckoocache.h b/src/cuckoocache.h --- a/src/cuckoocache.h +++ b/src/cuckoocache.h @@ -257,8 +257,8 @@ * high 32 bits of a 32*32->64 multiply, which means the operation is * reasonably fast even on a typical 32-bit processor. * - * @param e The element whose hashes will be returned - * @returns Deterministic hashes derived from `e` uniformly mapped onto the + * @param k The element whose hashes will be returned + * @returns Deterministic hashes derived from `k` uniformly mapped onto the * range [0, size) */ inline std::array compute_hashes(const Key &k) const { @@ -423,9 +423,9 @@ * * is not guaranteed to return true. * - * @param e the element to insert - * @param weither to replace if an existing element with the same key is - * found. + * @param e The element to insert + * @param replace Whether to replace if an existing element with the same + * key is found. * @post one of the following: All previously inserted elements and e are * now in the table, one previously inserted element is evicted from the * table, the entry attempted to be inserted is evicted. If replace is true @@ -526,8 +526,8 @@ * obtains the found element (for Elements that contain key and value, * this has the effect of obtaining the found value). * - * @param e the element to check - * @param erase + * @param e The element to check + * @param erase Whether to attempt setting the garbage collect flag * * @post If the element is found, it is copied into e. If erase is true * and the element is found, then the garbage collect flag is set. diff --git a/src/net_processing.cpp b/src/net_processing.cpp --- a/src/net_processing.cpp +++ b/src/net_processing.cpp @@ -930,7 +930,7 @@ * Decide a response for an Avalanche poll about the given block. * * @param[in] hash The hash of the block being polled for - * @param[out] uint32_t Our current vote for the block + * @return Our current vote for the block */ uint32_t GetAvalancheVoteForBlock(const BlockHash &hash) EXCLUSIVE_LOCKS_REQUIRED(cs_main); @@ -3064,7 +3064,7 @@ * Reconsider orphan transactions after a parent has been accepted to the * mempool. * - * @param[in/out] orphan_work_set The set of orphan transactions to + * @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. @@ -3366,9 +3366,9 @@ * FIXME This function should be expanded to return different vote responses * based on inspection of mempool. * - * @param[in] CTxMemPool The mempool to base our votes on - * @param[in] TxId The id of the transaction being polled for - * @param[out] uint32_t Our current vote for the proof + * @param[in] mempool The mempool to base our votes on + * @param[in] id The id of the transaction being polled for + * @return Our current vote for the proof */ static uint32_t getAvalancheVoteForTx(CTxMemPool &mempool, const TxId &id) { return -1; @@ -3377,8 +3377,8 @@ /** * Decide a response for an Avalanche poll about the given proof. * - * @param[in] avalanche::ProofId The id of the proof being polled for - * @param[out] uint32_t Our current vote for the proof + * @param[in] id The id of the proof being polled for + * @return Our current vote for the proof */ static uint32_t getAvalancheVoteForProof(const avalanche::ProofId &id) { assert(g_avalanche); diff --git a/src/netbase.h b/src/netbase.h --- a/src/netbase.h +++ b/src/netbase.h @@ -164,7 +164,7 @@ * @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. + * @param subnet The resulting internal representation of a subnet. * * @returns Whether the operation succeeded or not. */ diff --git a/src/util/message.h b/src/util/message.h --- a/src/util/message.h +++ b/src/util/message.h @@ -52,7 +52,7 @@ /** * Verify a signed message. - * @param[in] chain params to be used to interpret the address. + * @param[in] params Chain params to be used to interpret the address. * @param[in] address Signer's bitcoin address, it must refer to a public key. * @param[in] signature The signature in base64 format. * @param[in] message The message that was signed. diff --git a/src/util/sock.h b/src/util/sock.h --- a/src/util/sock.h +++ b/src/util/sock.h @@ -176,7 +176,7 @@ /** * 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 */ virtual bool IsConnected(std::string &errmsg) const; diff --git a/src/validation.h b/src/validation.h --- a/src/validation.h +++ b/src/validation.h @@ -1318,7 +1318,7 @@ /** * 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. */ diff --git a/src/validation.cpp b/src/validation.cpp --- a/src/validation.cpp +++ b/src/validation.cpp @@ -4172,11 +4172,11 @@ * Store a block on disk. * * @param[in] config The global config. - * @param[in-out] pblock The block we want to accept. + * @param[in,out] pblock The block we want to accept. * @param[in] fRequested A boolean to indicate if this block was requested * from our peers. * @param[in] dbp If non-null, the disk position of the block. - * @param[in-out] fNewBlock True if block was first received via this call. + * @param[in,out] fNewBlock True if block was first received via this call. * @return True if the block is accepted as a valid block and written to disk. */ bool CChainState::AcceptBlock(const Config &config, diff --git a/src/wallet/coinselection.cpp b/src/wallet/coinselection.cpp --- a/src/wallet/coinselection.cpp +++ b/src/wallet/coinselection.cpp @@ -17,6 +17,8 @@ } } descending; +static const size_t TOTAL_TRIES = 100000; + /** * This is the Branch and Bound Coin Selection algorithm designed by Murch. It * searches for an input set that can pay for the spending target and does not @@ -51,24 +53,20 @@ * Thesis: * https://murch.one/wp-content/uploads/2016/11/erhardt2016coinselection.pdf * - * @param const std::vector& utxo_pool The set of UTXOs that we are - * choosing from. These UTXOs will be sorted in descending order by effective - * value and the CInputCoins' values are their effective values. - * @param const Amount& target_value This is the value that we want to select. - * It is the lower bound of the range. - * @param const Amount& cost_of_change This is the cost of creating and - * spending a change output. This plus target_value is the upper bound of the - * range. - * @param std::set& out_set -> This is an output parameter for the - * set of CInputCoins that have been selected. - * @param Amount& value_ret -> This is an output parameter for the total value - * of the CInputCoins that were selected. - * @param Amount not_input_fees -> The fees that need to be paid for the - * outputs and fixed size overhead (version, locktime, marker and flag) + * @param utxo_pool The set of UTXOs that we are choosing from. These UTXOs will + * be sorted in descending order by effective value and the CInputCoins' + * values are their effective values. + * @param target_value This is the value that we want to select. + * It is the lower bound of the range. + * @param cost_of_change This is the cost of creating and spending a change + * output. This plus target_value is the upper bound of the range. + * @param out_set This is an output parameter for the set of CInputCoins that + * have been selected. + * @param value_ret This is an output parameter for the total value of the + * CInputCoins that were selected. + * @param not_input_fees -> The fees that need to be paid for the outputs and + * fixed size overhead (version, locktime, marker and flag) */ - -static const size_t TOTAL_TRIES = 100000; - bool SelectCoinsBnB(std::vector &utxo_pool, const Amount &target_value, const Amount &cost_of_change, std::set &out_set, Amount &value_ret, diff --git a/src/wallet/scriptpubkeyman.cpp b/src/wallet/scriptpubkeyman.cpp --- a/src/wallet/scriptpubkeyman.cpp +++ b/src/wallet/scriptpubkeyman.cpp @@ -77,7 +77,7 @@ //! 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 / //! witnessscript) //! @param recurse_scripthash whether to recurse into nested p2sh and p2wsh