dashpay / dash

Dash - Reinventing Cryptocurrency
https://www.dash.org
MIT License
1.49k stars 1.2k forks source link

fix: cppcheck warnings #6101

Closed knst closed 1 month ago

knst commented 2 months ago

Issue being fixed or feature implemented

cppcheck 2.11 on my localhost returns 2 failures, that are not caught by our CI, probably due to difference in version:

```
src/rpc/coinjoin.cpp:73:28: warning: Variable 'chainman' can be declared as reference to const [constVariableReference]
 src/masternode/utils.cpp:0:0: warning: Internal Error. MathLib::toLongNumber: input was not completely consumed: 5s [cppcheckError]

Advice not applicable in this specific case? Add an exception by updating
IGNORED_WARNINGS in test/lint/lint-cppcheck-dash.sh
```

What was done?

Adds missing const, workaround for probably a crash in cppcheck 2.11.

How Has This Been Tested?

Run test/lint/lint-cppcheck-dash.sh

Breaking Changes

N/A

Checklist: