aboutsummaryrefslogtreecommitdiff
path: root/test/functional
diff options
context:
space:
mode:
authorSuhas Daftuar <sdaftuar@chaincode.com>2017-10-11 08:55:14 -0400
committerMarcoFalke <falke.marco@gmail.com>2017-11-02 13:18:23 -0400
commitbf191a71836f357d7949459f666db506dffd123b (patch)
treef6f410b14e72bda966ef09956617bdd04a72f9f2 /test/functional
parentd570aa4290bf678bab764aa58dde19167bc927f5 (diff)
downloadbitcoin-bf191a71836f357d7949459f666db506dffd123b.tar.xz
Disconnecting from bad outbound peers in IBD
When in IBD, we'd like to use all our outbound peers to help us sync the chain. Disconnect any outbound peers whose headers have insufficient work. Github-Pull: #11490 Rebased-From: c60fd71a65e841efe187992f46c583a704cc37f5
Diffstat (limited to 'test/functional')
-rwxr-xr-xtest/functional/minchainwork.py8
1 files changed, 8 insertions, 0 deletions
diff --git a/test/functional/minchainwork.py b/test/functional/minchainwork.py
index c7579d2548..35cd7ad141 100755
--- a/test/functional/minchainwork.py
+++ b/test/functional/minchainwork.py
@@ -27,6 +27,7 @@ class MinimumChainWorkTest(BitcoinTestFramework):
def set_test_params(self):
self.setup_clean_chain = True
self.num_nodes = 3
+
self.extra_args = [[], ["-minimumchainwork=0x65"], ["-minimumchainwork=0x65"]]
self.node_min_work = [0, 101, 101]
@@ -74,6 +75,13 @@ class MinimumChainWorkTest(BitcoinTestFramework):
self.nodes[0].generate(1)
self.log.info("Verifying nodes are all synced")
+
+ # Because nodes in regtest are all manual connections (eg using
+ # addnode), node1 should not have disconnected node0. If not for that,
+ # we'd expect node1 to have disconnected node0 for serving an
+ # insufficient work chain, in which case we'd need to reconnect them to
+ # continue the test.
+
self.sync_all()
self.log.info("Blockcounts: %s", [n.getblockcount() for n in self.nodes])