Simplify ProcessGetBlockData execution by removing send flag #13250
pull pstratem wants to merge 2 commits into bitcoin:master from pstratem:2018-05-16-processgetblockdata changing 3 files +46 −11-
pstratem commented at 10:50 pm on May 16, 2018: contributorSetting the send flag to false can be replaced by simply returning.
-
MarcoFalke added the label P2P on May 16, 2018
-
pstratem commented at 11:12 pm on May 16, 2018: contributorthe send flag effectively exits the function whenever it’s set to false, this simply actually returns
-
MarcoFalke added the label Refactoring on May 16, 2018
-
sipa commented at 11:14 pm on May 16, 2018: memberYes, I can read the code. But can you actually put that in the PR description? The description goes into the merge commit for example, and is helpful for people investigating the history of code.
-
pstratem force-pushed on May 16, 2018
-
pstratem renamed this:
Simplify ProcessGetBlockData execution
Simplify ProcessGetBlockData execution by removing send flag
on May 16, 2018 -
in src/net_processing.cpp:1110 in 311af6cfc6 outdated
1107@@ -1109,35 +1108,35 @@ void static ProcessGetBlockData(CNode* pfrom, const Consensus::Params& consensus 1108 LOCK(cs_main); 1109 const CBlockIndex* pindex = LookupBlockIndex(inv.hash); 1110 if (pindex) {
skeees commented at 11:55 pm on May 16, 2018:you should return if pindex is not defined
pstratem commented at 1:00 am on May 17, 2018:indeed good catchpstratem force-pushed on May 17, 2018Simplify ProcessGetBlockData execution by removing send flag.
Setting the send flag to false can be replaced by simply returning.
pstratem force-pushed on May 17, 2018pstratem force-pushed on May 17, 2018fanquake commented at 2:05 am on May 17, 2018: memberTravis:
011.84s$ if [ "$TRAVIS_EVENT_TYPE" = "pull_request" ]; then contrib/devtools/lint-all.sh; fi 1./test/functional/p2p_invalid_getdata.py:31:1: W293 blank line contains whitespace 2^---- failure generated from contrib/devtools/lint-python.sh
pstratem force-pushed on May 17, 2018in test/functional/p2p_invalid_getdata.py:2 in 261026b645 outdated
0@@ -0,0 +1,36 @@ 1+#!/usr/bin/env python3 2+# Copyright (c) 2016-2017 The Bitcoin Core developers
Empact commented at 2:17 am on May 17, 2018:2018in test/functional/p2p_invalid_getdata.py:20 in 261026b645 outdated
15+ super().__init__() 16+ 17+class InvalidGetDataTest(BitcoinTestFramework): 18+ def set_test_params(self): 19+ self.setup_clean_chain = True 20+ self.num_nodes = 3
Empact commented at 2:18 am on May 17, 2018:Looks like you’re using 2 nodes below, index 0 and 1, is that right?pstratem force-pushed on May 19, 2018pstratem force-pushed on May 19, 2018pstratem force-pushed on May 19, 2018Functional test of receipt of invalid getdata request. dd5ee7fd3aDrahtBot commented at 11:22 am on July 14, 2018: memberDrahtBot added the label Needs rebase on Jul 14, 2018in test/functional/p2p_invalid_getdata.py:26 in dd5ee7fd3a
21+ 22+ def run_test(self): 23+ # Setup the p2p connections and start up the network thread. 24+ self.test_node = self.nodes[0].add_p2p_connection(TestP2PConn()) 25+ 26+ network_thread_start()
MarcoFalke commented at 11:50 am on July 14, 2018:nit: The thread is always running on master. Remove this line.fanquake closed this on Jul 15, 2018
laanwj removed the label Needs rebase on Oct 24, 2019MarcoFalke locked this on Dec 16, 2021
github-metadata-mirror
This is a metadata mirror of the GitHub repository bitcoin/bitcoin. This site is not affiliated with GitHub. Content is generated from a GitHub metadata backup.
generated: 2024-11-17 18:12 UTC
This site is hosted by @0xB10C
More mirrored repositories can be found on mirror.b10c.me