More mocktime related fixes

This commit is contained in:
UdjinM6 2019-08-12 20:10:56 +03:00 committed by Pasta
parent 59e57337e4
commit 3d6c5ac27a
No known key found for this signature in database
GPG Key ID: D362C9F7142766AE
2 changed files with 3 additions and 3 deletions

View File

@ -45,7 +45,7 @@ from test_framework.mininode import (CBlockHeader,
msg_headers) msg_headers)
from test_framework.script import (CScript, OP_TRUE) from test_framework.script import (CScript, OP_TRUE)
from test_framework.test_framework import BitcoinTestFramework from test_framework.test_framework import BitcoinTestFramework
from test_framework.util import (p2p_port, assert_equal, get_mocktime, set_mocktime, set_node_times) from test_framework.util import (p2p_port, assert_equal, set_node_times)
class BaseNode(NodeConnCB): class BaseNode(NodeConnCB):
def send_header_for_blocks(self, new_blocks): def send_header_for_blocks(self, new_blocks):
@ -183,7 +183,7 @@ class AssumeValidTest(BitcoinTestFramework):
node2.wait_for_verack() node2.wait_for_verack()
# Make sure nodes actually accept the many headers # Make sure nodes actually accept the many headers
self.set_mocktime(self.block_time) self.mocktime = self.block_time
set_node_times(self.nodes, self.mocktime) set_node_times(self.nodes, self.mocktime)
# send header lists to all three nodes. # send header lists to all three nodes.

View File

@ -44,7 +44,7 @@ class MaxUploadTest(BitcoinTestFramework):
# Advance all nodes 2 weeks in the future # Advance all nodes 2 weeks in the future
old_mocktime = self.mocktime old_mocktime = self.mocktime
current_mocktime = old_mocktime + 2*60*60*24*7 current_mocktime = old_mocktime + 2*60*60*24*7
self.set_mocktime(current_mocktime) self.mocktime = current_mocktime
set_node_times(self.nodes, current_mocktime) set_node_times(self.nodes, current_mocktime)
# Before we connect anything, we first set the time on the node # Before we connect anything, we first set the time on the node