Page MenuHomePhabricator

ProcessOrphanTx: remove useless setMisbehaving set
ClosedPublic

Authored by PiRK on Nov 2 2021, 10:40.

Details

Reviewers
majcosta
Group Reviewers
Restricted Project
Commits
rABCe2e197f5eff7: ProcessOrphanTx: remove useless setMisbehaving set
Summary

Original commit:

This starts empty, and is only added to if we're about to
exit the function (so we never read from it).

In the Bitcoin ABC codebase, setMisbehaving was replaced with rejectCountPerNode in D2676, and in D6683 it stopped being used.

This is a backport of core#19498 [3/5]
https://github.com/bitcoin/bitcoin/pull/19498/commits/4763b51bca86fb9e49175619a47cdbef34feaf99

Depends on D10413

Test Plan

ninja all check-all

Event Timeline

PiRK requested review of this revision.Nov 2 2021, 10:40

Tail of the build log:

[345/510] Building CXX object src/test/CMakeFiles/testutil.dir/util/transaction_utils.cpp.o
[346/510] Building CXX object src/test/CMakeFiles/testutil.dir/util/blockfilter.cpp.o
[347/510] Building CXX object src/wallet/CMakeFiles/wallet.dir/context.cpp.o
[348/510] Building CXX object src/test/CMakeFiles/testutil.dir/util/mining.cpp.o
[349/510] Building CXX object src/test/CMakeFiles/testutil.dir/util/net.cpp.o
[350/510] Building CXX object src/test/CMakeFiles/testutil.dir/util/wallet.cpp.o
[351/510] Building CXX object src/wallet/CMakeFiles/wallet-tool.dir/wallettool.cpp.o
[352/510] Linking C static library src/secp256k1/libsecp256k1.a
[353/510] Building CXX object src/test/CMakeFiles/testutil.dir/util/setup_common.cpp.o
[354/510] Building CXX object src/wallet/CMakeFiles/wallet.dir/coincontrol.cpp.o
[355/510] Building CXX object src/wallet/CMakeFiles/wallet.dir/coinselection.cpp.o
[356/510] Building CXX object src/wallet/CMakeFiles/wallet.dir/__/interfaces/wallet.cpp.o
[357/510] Building CXX object src/wallet/CMakeFiles/wallet.dir/bdb.cpp.o
[358/510] Building CXX object src/wallet/CMakeFiles/wallet.dir/db.cpp.o
[359/510] Building CXX object src/wallet/CMakeFiles/wallet.dir/crypter.cpp.o
[360/510] Building CXX object src/wallet/CMakeFiles/wallet.dir/fees.cpp.o
[361/510] Building CXX object src/wallet/CMakeFiles/wallet.dir/load.cpp.o
[362/510] Building CXX object src/wallet/CMakeFiles/wallet.dir/salvage.cpp.o
[363/510] Linking CXX static library src/libbitcoinconsensus.a
[364/510] Building CXX object src/wallet/CMakeFiles/wallet.dir/rpcdump.cpp.o
[365/510] Building CXX object src/wallet/CMakeFiles/wallet.dir/rpcwallet.cpp.o
[366/510] Installing component secp256k1
-- Install configuration: "RelWithDebInfo"
-- Install component: "secp256k1"
-- Installing: /results/artifacts/lib/libsecp256k1.a
-- Installing: /results/artifacts/include/secp256k1.h
-- Installing: /results/artifacts/include/secp256k1_preallocated.h
-- Installing: /results/artifacts/include/secp256k1_recovery.h
-- Installing: /results/artifacts/include/secp256k1_schnorr.h
[367/510] Linking C executable src/secp256k1/ecmult-bench
[368/510] Linking C executable src/secp256k1/internal-bench
[369/510] Linking C executable src/secp256k1/sign-bench
[370/510] Linking C executable src/secp256k1/recover-bench
[371/510] Building CXX object src/wallet/CMakeFiles/wallet.dir/scriptpubkeyman.cpp.o
[372/510] Linking C executable src/secp256k1/verify-bench
[373/510] Building CXX object src/seeder/CMakeFiles/seeder-base.dir/db.cpp.o
[374/510] Building CXX object src/seeder/CMakeFiles/seeder-base.dir/dns.cpp.o
[375/510] Building CXX object src/wallet/CMakeFiles/wallet.dir/walletutil.cpp.o
[376/510] Building CXX object src/wallet/CMakeFiles/wallet.dir/walletdb.cpp.o
[377/510] Building CXX object src/wallet/CMakeFiles/wallet.dir/wallet.cpp.o
[378/510] Building CXX object src/seeder/CMakeFiles/seeder-base.dir/bitcoin.cpp.o
[379/510] Building CXX object src/seeder/CMakeFiles/bitcoin-seeder.dir/main.cpp.o
[380/510] Linking CXX static library src/libscript.a
[381/510] Linking CXX static library src/libcommon.a
[382/510] Linking CXX shared library src/libbitcoinconsensus.so.0.24.5
[383/510] Linking CXX executable src/bitcoin-cli
[384/510] Creating library symlink src/libbitcoinconsensus.so.0 src/libbitcoinconsensus.so
[385/510] Linking CXX executable src/bitcoin-tx
[386/510] Linking CXX static library src/wallet/libwallet.a
[387/510] Linking CXX static library src/wallet/libwallet-tool.a
[388/510] Linking CXX executable src/bitcoin-wallet
[389/510] Building CXX object src/CMakeFiles/server.dir/net_processing.cpp.o
FAILED: src/CMakeFiles/server.dir/net_processing.cpp.o 
/usr/bin/ccache /usr/bin/clang++  -DBOOST_AC_USE_STD_ATOMIC -DBOOST_SP_USE_STD_ATOMIC -DBUILD_BITCOIN_INTERNAL -DENABLE_AVX2 -DENABLE_SHANI -DENABLE_SSE41 -DHAVE_BUILD_INFO -DHAVE_CONFIG_H -DHAVE_CONSENSUS_LIB -DLEVELDB_ATOMIC_PRESENT -DLEVELDB_PLATFORM_POSIX -DOS_LINUX -I../../src/leveldb/helpers/memenv -I../../src/. -Isrc -I../../src/univalue/include -Isrc/crypto/.. -I../../src/secp256k1/include -I../../src/leveldb/include -isystem /usr/include/jemalloc -isystem /usr/include/miniupnpc -Werror -g -O2 -fPIC -fvisibility=hidden   -fstack-protector-all -Wstack-protector -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=2 -Wall -Wextra -Wformat -Wgnu -Wvla -Wcast-align -Wunused-parameter -Wmissing-braces -Wthread-safety -Wrange-loop-analysis -Wredundant-decls -Wunreachable-code-loop-increment -Wsign-compare -Wconditional-uninitialized -Wformat-security -Wredundant-move -Woverloaded-virtual -Wshadow -Wshadow-field -Wno-unused-parameter -Wno-implicit-fallthrough -pthread -std=gnu++17 -MD -MT src/CMakeFiles/server.dir/net_processing.cpp.o -MF src/CMakeFiles/server.dir/net_processing.cpp.o.d -o src/CMakeFiles/server.dir/net_processing.cpp.o -c ../../src/net_processing.cpp
../../src/net_processing.cpp:283:27: error: unused variable 'MAX_NON_STANDARD_ORPHAN_PER_NODE' [-Werror,-Wunused-const-variable]
static constexpr uint32_t MAX_NON_STANDARD_ORPHAN_PER_NODE = 5;
                          ^
1 error generated.
ninja: build stopped: cannot make progress due to previous errors.
Build build-clang failed with exit code 1
majcosta requested changes to this revision.Nov 2 2021, 18:16
majcosta added a subscriber: majcosta.

apparently MAX_NON_STANDARD_ORPHAN_PER_NODE is also unused now

also, while it's clarifying to point out in the summary that setMisbehaving was changed by us to rejectCountPerNode, changing the title of the commit is just confusing, I'd suggest using the original

This revision now requires changes to proceed.Nov 2 2021, 18:16
PiRK retitled this revision from ProcessOrphanTx: remove useless rejectCountPerNode map to ProcessOrphanTx: remove useless setMisbehaving set.

remove unused constant and use original commit title

This revision is now accepted and ready to land.Nov 2 2021, 20:45