Rebased/nits fixed version of #13250.
Setting the send flag to false can be replaced by simply returning.
5+"""Request non-existent block.
6+"""
7+
8+from test_framework.mininode import *
9+from test_framework.test_framework import BitcoinTestFramework
10+from test_framework.util import *
0@@ -0,0 +1,32 @@
1+#!/usr/bin/env python3
2+# Copyright (c) 2018 The Bitcoin Core developers
3+# Distributed under the MIT software license, see the accompanying
4+# file COPYING or http://www.opensource.org/licenses/mit-license.php.
5+"""Request non-existent block.
6+"""
7+
8+from test_framework.mininode import *
Specify:
0from test_framework.mininode import (CInv, P2PInterface, msg_getdata)
I think it is somewhat subjective whether an early return is preferable to a status variable.
ACK on the test in any case.
9+from test_framework.test_framework import BitcoinTestFramework
10+
11+# TestP2PConn: A peer we use to send messages to bitcoind, and store responses.
12+class TestP2PConn(P2PInterface):
13+ def __init__(self):
14+ super().__init__()
17+ # Setup the p2p connections and start up the network thread.
18+ self.test_node = self.nodes[0].add_p2p_connection(P2PInterface())
19+
20+ self.test_node.wait_for_verack()
21+
22+ self.test_node.send_message(msg_getdata(inv=[CInv(2, 0)]))
Setting the send flag to false can be replaced by simply returning.
utACK 0cf546f71ebbee960fdca044e7abd100eec7b688 …
… as long as these horrible single line if statements with multiple nested parens are cleaned up soon after