Skip to content

Nit: Fix compiler warning for g++-8 in txmempool.cpp

Summary

When working on other code, I noticed that on Linux on g++-8, I was getting the following compiler warning when compiling txmempool.cpp:

../src/txmempool.cpp: In lambda function:
../src/txmempool.cpp:903:20: warning: declaration of ‘const TxId txId’ shadows a parameter [-Wshadow]
         const TxId txId{txit->GetTx().GetId()};
                    ^~~~
../src/txmempool.cpp:893:53: note: shadowed declaration is here
  auto CTxMemPool::recursiveDSProofSearch(const TxId &txId, DspDescendants *desc, double *score) const
                                         ~~~~~~~~~~~~^~~~

This commit fixes the warning.

Test Plan

No real changes to this codebase occur here. But:

  • ninja -v on gcc8 build of master without this MR patch shows the warning, while with this patch the warning is gone.

For safety, run tests:

  • ninja all check check-functional
Edited by freetrader

Merge request reports