-
Notifications
You must be signed in to change notification settings - Fork 37.7k
refactor: Remove redundant definitions #29492
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
Conversation
The following sections might be updated with supplementary metadata relevant to reviewers and maintainers. Code Coverage & BenchmarksFor details see: https://corecheck.dev/bitcoin/bitcoin/pulls/29492. ReviewsSee the guideline for information on the review process.
If your review is incorrectly listed, please react with 👎 to this comment and the bot will ignore it on the next update. ConflictsNo conflicts as of last run. |
b1fe46a
to
da188bf
Compare
My inclination would be to fix the |
Are you still working on this? |
@@ -3037,8 +3037,6 @@ bool PeerManagerImpl::ProcessOrphanTx(Peer& peer) | |||
AssertLockHeld(g_msgproc_mutex); | |||
LOCK(cs_main); | |||
|
|||
CTransactionRef porphanTx = nullptr; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I wonder why clang-tidy can't pick this one up. Ref: https://github.com/bitcoin/bitcoin/pull/31051/files
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe we can circle back with a future version.
common/init.cpp:73:31: error: declaration shadows a local variable [-Werror,-Wshadow] const std::string error = strprintf( ^ common/init.cpp:37:21: note: previous declaration is here std::string error; ^
net_processing.cpp:3042:28: error: declaration shadows a local variable [-Werror,-Wshadow] while (CTransactionRef porphanTx = m_orphanage.GetTxToReconsider(peer.m_id)) { ^ net_processing.cpp:3040:21: note: previous declaration is here CTransactionRef porphanTx = nullptr; ^
wallet/wallet.cpp:901:48: error: declaration shadows a typedef in 'wallet::CWallet' [-Werror,-Wshadow] typedef std::multimap<int64_t, CWalletTx*> TxItems; ^ ./wallet/wallet.h:483:48: note: previous declaration is here typedef std::multimap<int64_t, CWalletTx*> TxItems; ^
test/key_tests.cpp:184:21: error: declaration shadows a local variable [-Werror,-Wshadow] std::string msg = "A message to be signed" + ToString(i); ^ test/key_tests.cpp:161:17: note: previous declaration is here std::string msg = "A message to be signed"; ^
da188bf
to
6d300e8
Compare
tend towards NACK, without a motivation (example of a real bug that this prevents or prevented):
|
Closing for now. |
These were identified via
-Wshadow
in #29485, see the commit messagesfor the associated compiler message.