@@ -103,7 +103,7 @@ def run_test(self):
103103 self .log .info ("Non-existent peer generates error, even if we already have the block" )
104104 assert_raises_rpc_error (- 1 , "Block already downloaded" , self .nodes [0 ].getblockfrompeer , short_tip , peer_0_peer_1_id + 1 )
105105
106- self .log .info ("Don't fetch blocks while the node has not synced past it yet" )
106+ self .log .info ("Do fetch blocks even if the node has not synced past it yet" )
107107 # For this test we need node 1 in prune mode and as a side effect this also disconnects
108108 # the nodes which is also necessary for the rest of the test.
109109 self .restart_node (1 , ["-prune=550" ])
@@ -119,13 +119,13 @@ def run_test(self):
119119 node1_interface .send_and_ping (msg_headers ([block ]))
120120
121121 # Get the peer id of the P2PInterface from the pruning node
122+ node1_interface = self .nodes [1 ].add_p2p_connection (P2PInterface ())
122123 node1_peers = self .nodes [1 ].getpeerinfo ()
123- assert_equal (len (node1_peers ), 1 )
124- node1_interface_id = node1_peers [0 ]["id" ]
124+ assert_equal (len (node1_peers ), 2 )
125+ node1_interface_id = node1_peers [1 ]["id" ]
125126
126- # Trying to fetch this block from the P2PInterface should not be possible
127- error_msg = "In prune mode, only blocks that the node has already synced previously can be fetched from a peer"
128- assert_raises_rpc_error (- 1 , error_msg , self .nodes [1 ].getblockfrompeer , blockhash , node1_interface_id )
127+ # Trying to fetch this block from the P2PInterface should be possible
128+ assert_equal (self .nodes [1 ].getblockfrompeer (blockhash , node1_interface_id ), {})
129129
130130 self .log .info ("Connect pruned node" )
131131 self .connect_nodes (0 , 2 )
0 commit comments