diff --git a/qa/rpc-tests/abandonconflict.py b/qa/rpc-tests/abandonconflict.py --- a/qa/rpc-tests/abandonconflict.py +++ b/qa/rpc-tests/abandonconflict.py @@ -8,9 +8,6 @@ from test_framework.util import * import urllib.parse -# far in the past -UAHF_START_TIME = 30000000 - class AbandonConflictTest(BitcoinTestFramework): @@ -24,12 +21,10 @@ self.nodes.append( start_node(0, self.options.tmpdir, ["-debug", "-logtimemicros", - "-minrelaytxfee=0.00001", - "-uahfstarttime=%d" % UAHF_START_TIME])) + "-minrelaytxfee=0.00001"])) self.nodes.append( start_node(1, self.options.tmpdir, ["-debug", - "-logtimemicros", - "-uahfstarttime=%d" % UAHF_START_TIME])) + "-logtimemicros"])) connect_nodes(self.nodes[0], 1) def run_test(self): @@ -99,8 +94,7 @@ stop_node(self.nodes[0], 0) self.nodes[0] = start_node(0, self.options.tmpdir, [ "-debug", "-logtimemicros", - "-minrelaytxfee=0.0001", - "-uahfstarttime=%d" % UAHF_START_TIME]) + "-minrelaytxfee=0.0001"]) # Verify txs no longer in mempool assert_equal(len(self.nodes[0].getrawmempool()), 0) @@ -131,8 +125,7 @@ stop_node(self.nodes[0], 0) self.nodes[0] = start_node(0, self.options.tmpdir, [ "-debug", "-logtimemicros", - "-minrelaytxfee=0.00001", - "-uahfstarttime=%d" % UAHF_START_TIME]) + "-minrelaytxfee=0.00001"]) assert_equal(len(self.nodes[0].getrawmempool()), 0) assert_equal(self.nodes[0].getbalance(), balance) @@ -155,8 +148,7 @@ stop_node(self.nodes[0], 0) self.nodes[0] = start_node(0, self.options.tmpdir, [ "-debug", "-logtimemicros", - "-minrelaytxfee=0.0001", - "-uahfstarttime=%d" % UAHF_START_TIME]) + "-minrelaytxfee=0.0001"]) assert_equal(len(self.nodes[0].getrawmempool()), 0) newbalance = self.nodes[0].getbalance() assert_equal(newbalance, balance - Decimal("24.9996")) diff --git a/qa/rpc-tests/abc-p2p-fullblocktest.py b/qa/rpc-tests/abc-p2p-fullblocktest.py --- a/qa/rpc-tests/abc-p2p-fullblocktest.py +++ b/qa/rpc-tests/abc-p2p-fullblocktest.py @@ -21,10 +21,6 @@ from test_framework.cdefs import (ONE_MEGABYTE, LEGACY_MAX_BLOCK_SIZE, MAX_BLOCK_SIGOPS_PER_MB, MAX_TX_SIGOPS_COUNT) -# far into the past -UAHF_START_TIME = 30000000 - - class PreviousSpendableOutput(object): def __init__(self, tx=CTransaction(), n=-1): @@ -89,7 +85,6 @@ '-limitdescendantcount=9999', '-limitdescendantsize=9999', '-maxmempool=999', - "-uahfstarttime=%d" % UAHF_START_TIME, "-excessiveblocksize=%d" % self.excessive_block_size]] self.nodes = start_nodes(self.num_nodes, self.options.tmpdir, diff --git a/qa/rpc-tests/bip65-cltv-p2p.py b/qa/rpc-tests/bip65-cltv-p2p.py --- a/qa/rpc-tests/bip65-cltv-p2p.py +++ b/qa/rpc-tests/bip65-cltv-p2p.py @@ -12,9 +12,6 @@ from io import BytesIO import time -# far in the past -UAHF_START_TIME = 30000000 - def cltv_invalidate(tx): '''Modify the signature in vin 0 of the tx to fail CLTV @@ -50,8 +47,7 @@ self.nodes = start_nodes(self.num_nodes, self.options.tmpdir, extra_args=[['-debug', '-whitelist=127.0.0.1', - '-blockversion=3', - "-uahfstarttime=%d" % UAHF_START_TIME]], + '-blockversion=3']], binary=[self.options.testbinary]) def run_test(self): diff --git a/qa/rpc-tests/bip68-112-113-p2p.py b/qa/rpc-tests/bip68-112-113-p2p.py --- a/qa/rpc-tests/bip68-112-113-p2p.py +++ b/qa/rpc-tests/bip68-112-113-p2p.py @@ -12,9 +12,6 @@ from io import BytesIO import time -# far in the past -UAHF_START_TIME = 30000000 - ''' This test is meant to exercise activation of the first version bits soft fork This soft fork will activate the following BIPS: @@ -109,8 +106,7 @@ self.nodes = start_nodes(self.num_nodes, self.options.tmpdir, extra_args=[['-debug', '-whitelist=127.0.0.1', - '-blockversion=4', - "-uahfstarttime=%d" % UAHF_START_TIME]], + '-blockversion=4']], binary=[self.options.testbinary]) def run_test(self): diff --git a/qa/rpc-tests/bip68-sequence.py b/qa/rpc-tests/bip68-sequence.py --- a/qa/rpc-tests/bip68-sequence.py +++ b/qa/rpc-tests/bip68-sequence.py @@ -21,9 +21,6 @@ # RPC error for non-BIP68 final transactions NOT_FINAL_ERROR = "64: non-BIP68-final" -# far in the past -UAHF_START_TIME = 30000000 - class BIP68Test(BitcoinTestFramework): @@ -36,13 +33,11 @@ self.nodes = [] self.nodes.append( start_node(0, self.options.tmpdir, ["-debug", - "-blockprioritysize=0", - "-uahfstarttime=%d" % UAHF_START_TIME])) + "-blockprioritysize=0"])) self.nodes.append( start_node(1, self.options.tmpdir, ["-debug", "-blockprioritysize=0", - "-acceptnonstdtxn=0", - "-uahfstarttime=%d" % UAHF_START_TIME])) + "-acceptnonstdtxn=0"])) self.is_network_split = False self.relayfee = self.nodes[0].getnetworkinfo()["relayfee"] connect_nodes(self.nodes[0], 1) diff --git a/qa/rpc-tests/bip9-softforks.py b/qa/rpc-tests/bip9-softforks.py --- a/qa/rpc-tests/bip9-softforks.py +++ b/qa/rpc-tests/bip9-softforks.py @@ -14,9 +14,6 @@ import time import itertools -# far in the past -UAHF_START_TIME = 30000000 - ''' This test is meant to exercise BIP forks Connect to a single node. @@ -41,8 +38,7 @@ def setup_network(self): self.nodes = start_nodes(self.num_nodes, self.options.tmpdir, extra_args=[['-debug', - '-whitelist=127.0.0.1', - "-uahfstarttime=%d" % UAHF_START_TIME]], + '-whitelist=127.0.0.1']], binary=[self.options.testbinary]) def run_test(self): diff --git a/qa/rpc-tests/bipdersig-p2p.py b/qa/rpc-tests/bipdersig-p2p.py --- a/qa/rpc-tests/bipdersig-p2p.py +++ b/qa/rpc-tests/bipdersig-p2p.py @@ -12,9 +12,6 @@ from io import BytesIO import time -# far in the past -UAHF_START_TIME = 30000000 - # A canonical signature consists of: # <30> <02> <02> @@ -59,8 +56,7 @@ self.nodes = start_nodes(self.num_nodes, self.options.tmpdir, extra_args=[['-debug', '-whitelist=127.0.0.1', - '-blockversion=2', - "-uahfstarttime=%d" % UAHF_START_TIME]], + '-blockversion=2']], binary=[self.options.testbinary]) def run_test(self): diff --git a/qa/rpc-tests/fundrawtransaction.py b/qa/rpc-tests/fundrawtransaction.py --- a/qa/rpc-tests/fundrawtransaction.py +++ b/qa/rpc-tests/fundrawtransaction.py @@ -6,9 +6,6 @@ from test_framework.test_framework import BitcoinTestFramework from test_framework.util import * -# far into the past -UAHF_START_TIME = 30000000 - def get_unspent(listunspent, amount): for utx in listunspent: @@ -26,9 +23,7 @@ self.num_nodes = 4 def setup_network(self, split=False): - self.nodes = start_nodes(self.num_nodes, self.options.tmpdir, - [["-uahfstarttime=%d" % UAHF_START_TIME] - for i in range(4)]) + self.nodes = start_nodes(self.num_nodes, self.options.tmpdir) connect_nodes_bi(self.nodes, 0, 1) connect_nodes_bi(self.nodes, 1, 2) @@ -490,9 +485,7 @@ stop_node(self.nodes[1], 2) stop_node(self.nodes[2], 3) - self.nodes = start_nodes(self.num_nodes, self.options.tmpdir, - [["-uahfstarttime=%d" % UAHF_START_TIME] - for i in range(4)]) + self.nodes = start_nodes(self.num_nodes, self.options.tmpdir) # This test is not meant to test fee estimation and we'd like # to be sure all txs are sent at a consistent desired feerate for node in self.nodes: diff --git a/qa/rpc-tests/import-rescan.py b/qa/rpc-tests/import-rescan.py --- a/qa/rpc-tests/import-rescan.py +++ b/qa/rpc-tests/import-rescan.py @@ -28,9 +28,6 @@ import enum import itertools -# far in the past -UAHF_START_TIME = 30000000 - Call = enum.Enum("Call", "single multi") Data = enum.Enum("Data", "address pub priv") Rescan = enum.Enum("Rescan", "no yes late_timestamp") @@ -129,8 +126,7 @@ self.num_nodes = 2 + len(IMPORT_NODES) def setup_network(self): - extra_args = [["-debug=1", "-uahfstarttime=%d" % UAHF_START_TIME] - for _ in range(self.num_nodes)] + extra_args = [["-debug=1"] for _ in range(self.num_nodes)] for i, import_node in enumerate(IMPORT_NODES, 2): if import_node.prune: extra_args[i] += ["-prune=1"] diff --git a/qa/rpc-tests/listtransactions.py b/qa/rpc-tests/listtransactions.py --- a/qa/rpc-tests/listtransactions.py +++ b/qa/rpc-tests/listtransactions.py @@ -10,9 +10,6 @@ from test_framework.mininode import CTransaction, COIN from io import BytesIO -# far in the past -UAHF_START_TIME = 30000000 - def txFromHex(hexstring): tx = CTransaction() @@ -31,8 +28,7 @@ def setup_nodes(self): # This test requires mocktime enable_mocktime() - return start_nodes(self.num_nodes, self.options.tmpdir, - [["-uahfstarttime=%d" % UAHF_START_TIME] for i in range(self.num_nodes)]) + return start_nodes(self.num_nodes, self.options.tmpdir) def run_test(self): # Simple send, 0 to 1: diff --git a/qa/rpc-tests/maxuploadtarget.py b/qa/rpc-tests/maxuploadtarget.py --- a/qa/rpc-tests/maxuploadtarget.py +++ b/qa/rpc-tests/maxuploadtarget.py @@ -9,9 +9,6 @@ import time from test_framework.cdefs import LEGACY_MAX_BLOCK_SIZE -# far in the past -UAHF_START_TIME = 30000000 - ''' Test behavior of -maxuploadtarget. @@ -103,8 +100,7 @@ self.nodes = [] self.nodes.append( start_node( - 0, self.options.tmpdir, ["-debug", "-maxuploadtarget=200", - "-uahfstarttime=%d" % UAHF_START_TIME])) + 0, self.options.tmpdir, ["-debug", "-maxuploadtarget=200"])) def run_test(self): # Before we connect anything, we first set the time on the node @@ -217,8 +213,7 @@ print("Restarting nodes with -whitelist=127.0.0.1") stop_node(self.nodes[0], 0) self.nodes[0] = start_node(0, self.options.tmpdir, [ - "-debug", "-whitelist=127.0.0.1", "-maxuploadtarget=1", - "-uahfstarttime=%d" % UAHF_START_TIME]) + "-debug", "-whitelist=127.0.0.1", "-maxuploadtarget=1"]) # recreate/reconnect 3 test nodes test_nodes = [] diff --git a/qa/rpc-tests/mempool-accept-txn.py b/qa/rpc-tests/mempool-accept-txn.py --- a/qa/rpc-tests/mempool-accept-txn.py +++ b/qa/rpc-tests/mempool-accept-txn.py @@ -19,9 +19,6 @@ import struct from test_framework.cdefs import MAX_STANDARD_TX_SIGOPS -# far into the past -UAHF_START_TIME = 30000000 - # Error for too many sigops in one TX TXNS_TOO_MANY_SIGOPS_ERROR = b'bad-txns-too-many-sigops' RPC_TXNS_TOO_MANY_SIGOPS_ERROR = "64: " + \ @@ -52,8 +49,7 @@ self.blocks = {} def setup_network(self): - self.extra_args = [['-norelaypriority', - "-uahfstarttime=%d" % UAHF_START_TIME]] + self.extra_args = [['-norelaypriority']] self.nodes = start_nodes(self.num_nodes, self.options.tmpdir, self.extra_args, binary=[self.options.testbinary]) diff --git a/qa/rpc-tests/mempool_limit.py b/qa/rpc-tests/mempool_limit.py --- a/qa/rpc-tests/mempool_limit.py +++ b/qa/rpc-tests/mempool_limit.py @@ -8,9 +8,6 @@ from test_framework.test_framework import BitcoinTestFramework from test_framework.util import * -# far in the past -UAHF_START_TIME = 30000000 - class MempoolLimitTest(BitcoinTestFramework): @@ -19,8 +16,7 @@ self.nodes.append( start_node(0, self.options.tmpdir, ["-maxmempool=5", "-spendzeroconfchange=0", - "-debug", - "-uahfstarttime=%d" % UAHF_START_TIME])) + "-debug"])) self.is_network_split = False self.sync_all() self.relayfee = self.nodes[0].getnetworkinfo()['relayfee'] diff --git a/qa/rpc-tests/mempool_packages.py b/qa/rpc-tests/mempool_packages.py --- a/qa/rpc-tests/mempool_packages.py +++ b/qa/rpc-tests/mempool_packages.py @@ -9,8 +9,6 @@ from test_framework.util import * from test_framework.mininode import COIN -# far in the past -UAHF_START_TIME = 30000000 MAX_ANCESTORS = 25 MAX_DESCENDANTS = 25 @@ -25,14 +23,11 @@ def setup_network(self): self.nodes = [] self.nodes.append( - start_node(0, self.options.tmpdir, ["-maxorphantx=1000", - "-debug", - "-uahfstarttime=%d" % UAHF_START_TIME])) + start_node(0, self.options.tmpdir, ["-maxorphantx=1000", "-debug"])) self.nodes.append( start_node(1, self.options.tmpdir, ["-maxorphantx=1000", "-limitancestorcount=5", - "-debug", - "-uahfstarttime=%d" % UAHF_START_TIME])) + "-debug"])) connect_nodes(self.nodes[0], 1) self.is_network_split = False self.sync_all() diff --git a/qa/rpc-tests/mempool_reorg.py b/qa/rpc-tests/mempool_reorg.py --- a/qa/rpc-tests/mempool_reorg.py +++ b/qa/rpc-tests/mempool_reorg.py @@ -11,9 +11,6 @@ from test_framework.test_framework import BitcoinTestFramework from test_framework.util import * -# far in the past -UAHF_START_TIME = 30000000 - # Create one-input, one-output, no-fee transaction: @@ -27,8 +24,7 @@ alert_filename = None # Set by setup_network def setup_network(self): - args = ["-checkmempool", "-debug=mempool", - "-uahfstarttime=%d" % UAHF_START_TIME] + args = ["-checkmempool", "-debug=mempool"] self.nodes = [] self.nodes.append(start_node(0, self.options.tmpdir, args)) self.nodes.append(start_node(1, self.options.tmpdir, args)) diff --git a/qa/rpc-tests/mempool_resurrect_test.py b/qa/rpc-tests/mempool_resurrect_test.py --- a/qa/rpc-tests/mempool_resurrect_test.py +++ b/qa/rpc-tests/mempool_resurrect_test.py @@ -11,9 +11,6 @@ from test_framework.test_framework import BitcoinTestFramework from test_framework.util import * -# far in the past -UAHF_START_TIME = 30000000 - # Create one-input, one-output, no-fee transaction: @@ -26,8 +23,7 @@ def setup_network(self): # Just need one node for this test - args = ["-checkmempool", "-debug=mempool", - "-uahfstarttime=%d" % UAHF_START_TIME] + args = ["-checkmempool", "-debug=mempool"] self.nodes = [] self.nodes.append(start_node(0, self.options.tmpdir, args)) self.is_network_split = False diff --git a/qa/rpc-tests/mempool_spendcoinbase.py b/qa/rpc-tests/mempool_spendcoinbase.py --- a/qa/rpc-tests/mempool_spendcoinbase.py +++ b/qa/rpc-tests/mempool_spendcoinbase.py @@ -16,9 +16,6 @@ from test_framework.test_framework import BitcoinTestFramework from test_framework.util import * -# far in the past -UAHF_START_TIME = 30000000 - # Create one-input, one-output, no-fee transaction: @@ -31,8 +28,7 @@ def setup_network(self): # Just need one node for this test - args = ["-checkmempool", "-debug=mempool", - "-uahfstarttime=%d" % UAHF_START_TIME] + args = ["-checkmempool", "-debug=mempool"] self.nodes = [] self.nodes.append(start_node(0, self.options.tmpdir, args)) self.is_network_split = False diff --git a/qa/rpc-tests/merkle_blocks.py b/qa/rpc-tests/merkle_blocks.py --- a/qa/rpc-tests/merkle_blocks.py +++ b/qa/rpc-tests/merkle_blocks.py @@ -10,9 +10,6 @@ from test_framework.test_framework import BitcoinTestFramework from test_framework.util import * -# far into the past -UAHF_START_TIME = 30000000 - class MerkleBlockTest(BitcoinTestFramework): @@ -24,15 +21,13 @@ def setup_network(self): self.nodes = [] # Nodes 0/1 are "wallet" nodes - extra_args = ["-debug", "-uahfstarttime=%d" % UAHF_START_TIME] + extra_args = ["-debug"] self.nodes.append(start_node(0, self.options.tmpdir, extra_args)) self.nodes.append(start_node(1, self.options.tmpdir, extra_args)) # Nodes 2/3 are used for testing self.nodes.append(start_node(2, self.options.tmpdir, extra_args)) self.nodes.append( - start_node(3, self.options.tmpdir, ["-debug", - "-uahfstarttime=%d" % UAHF_START_TIME, - "-txindex"])) + start_node(3, self.options.tmpdir, ["-debug", "-txindex"])) connect_nodes(self.nodes[0], 1) connect_nodes(self.nodes[0], 2) connect_nodes(self.nodes[0], 3) diff --git a/qa/rpc-tests/nulldummy.py b/qa/rpc-tests/nulldummy.py --- a/qa/rpc-tests/nulldummy.py +++ b/qa/rpc-tests/nulldummy.py @@ -11,8 +11,6 @@ from io import BytesIO import time -# far into the past -UAHF_START_TIME = 30000000 NULLDUMMY_ERROR = "64: non-mandatory-script-verify-flag (Dummy CHECKMULTISIG argument must be zero)" @@ -52,8 +50,7 @@ self.nodes = start_nodes(self.num_nodes, self.options.tmpdir, extra_args=[['-debug', '-whitelist=127.0.0.1', - '-walletprematurewitness', - "-uahfstarttime=%d" % UAHF_START_TIME]]) + '-walletprematurewitness']]) def run_test(self): self.address = self.nodes[0].getnewaddress() diff --git a/qa/rpc-tests/p2p-feefilter.py b/qa/rpc-tests/p2p-feefilter.py --- a/qa/rpc-tests/p2p-feefilter.py +++ b/qa/rpc-tests/p2p-feefilter.py @@ -9,9 +9,6 @@ from test_framework.util import * import time -# far in the past -UAHF_START_TIME = 30000000 - ''' FeeFilterTest -- test processing of feefilter messages ''' @@ -66,8 +63,7 @@ # Node1 will be used to generate txs which should be relayed from Node0 # to our test node self.nodes = [] - extra_args = ["-debug", "-logtimemicros", - "-uahfstarttime=%d" % UAHF_START_TIME] + extra_args = ["-debug", "-logtimemicros"] self.nodes.append( start_node(0, self.options.tmpdir, extra_args)) self.nodes.append( diff --git a/qa/rpc-tests/prioritise_transaction.py b/qa/rpc-tests/prioritise_transaction.py --- a/qa/rpc-tests/prioritise_transaction.py +++ b/qa/rpc-tests/prioritise_transaction.py @@ -13,9 +13,6 @@ from test_framework.mininode import COIN from test_framework.cdefs import LEGACY_MAX_BLOCK_SIZE -# far in the past -UAHF_START_TIME = 30000000 - class PrioritiseTransactionTest(BitcoinTestFramework): @@ -31,9 +28,7 @@ self.is_network_split = False self.nodes.append( - start_node(0, self.options.tmpdir, ["-debug", - "-printpriority=1", - "-uahfstarttime=%d" % UAHF_START_TIME])) + start_node(0, self.options.tmpdir, ["-debug", "-printpriority=1"])) self.relayfee = self.nodes[0].getnetworkinfo()['relayfee'] def run_test(self): diff --git a/qa/rpc-tests/pruning.py b/qa/rpc-tests/pruning.py --- a/qa/rpc-tests/pruning.py +++ b/qa/rpc-tests/pruning.py @@ -17,9 +17,6 @@ import time import os -# far in the past -UAHF_START_TIME = 30000000 - MIN_BLOCKS_TO_KEEP = 288 # Rescans start at the earliest block up to 2 hours before a key timestamp, so @@ -53,15 +50,13 @@ start_node(0, self.options.tmpdir, ["-debug", "-maxreceivebuffer=20000", "-checkblocks=5", - "-blockmaxsize=1000000", - "-uahfstarttime=%d" % UAHF_START_TIME], + "-blockmaxsize=1000000"], timewait=900)) self.nodes.append( start_node(1, self.options.tmpdir, ["-debug", "-maxreceivebuffer=20000", "-checkblocks=5", - "-blockmaxsize=1000000", - "-uahfstarttime=%d" % UAHF_START_TIME], + "-blockmaxsize=1000000"], timewait=900)) # Create node 2 to test pruning @@ -69,8 +64,7 @@ start_node(2, self.options.tmpdir, ["-debug", "-maxreceivebuffer=20000", "-prune=550", - "-blockmaxsize=1000000", - "-uahfstarttime=%d" % UAHF_START_TIME], + "-blockmaxsize=1000000"], timewait=900)) self.prunedir = self.options.tmpdir + "/node2/regtest/blocks/" @@ -79,22 +73,19 @@ self.nodes.append( start_node(3, self.options.tmpdir, ["-debug=0", "-maxreceivebuffer=20000", - "-blockmaxsize=1000000", - "-uahfstarttime=%d" % UAHF_START_TIME], + "-blockmaxsize=1000000"], timewait=900)) self.nodes.append( start_node(4, self.options.tmpdir, ["-debug=0", "-maxreceivebuffer=20000", - "-blockmaxsize=1000000", - "-uahfstarttime=%d" % UAHF_START_TIME], + "-blockmaxsize=1000000"], timewait=900)) # Create nodes 5 to test wallet in prune mode, but do not connect self.nodes.append( start_node(5, self.options.tmpdir, ["-debug=0", "-prune=550", - "-blockmaxsize=1000000", - "-uahfstarttime=%d" % UAHF_START_TIME])) + "-blockmaxsize=1000000"])) # Determine default relay fee self.relayfee = self.nodes[0].getnetworkinfo()["relayfee"] @@ -157,8 +148,7 @@ self.nodes[0] = start_node(0, self.options.tmpdir, ["-debug", "-maxreceivebuffer=20000", "-checkblocks=5", - "-blockmaxsize=1000000", - "-uahfstarttime=%d" % UAHF_START_TIME], + "-blockmaxsize=1000000"], timewait=900) # Mine 24 blocks in node 1 for i in range(24): @@ -192,8 +182,7 @@ "-maxreceivebuffer=20000", "-blockmaxsize=5000", "-checkblocks=5", - "-disablesafemode", - "-uahfstarttime=%d" % UAHF_START_TIME], + "-disablesafemode"], timewait=900, stderr_checker=OutputChecker()) height = self.nodes[1].getblockcount() @@ -223,8 +212,7 @@ "-blockmaxsize=5000", "-checkblocks=5", "-disablesafemode", - "-blockmaxsize=1000000", - "-uahfstarttime=%d" % UAHF_START_TIME], + "-blockmaxsize=1000000"], timewait=900, stderr_checker=OutputChecker()) print("Generating new longer chain of 300 more blocks") @@ -311,7 +299,7 @@ # at this point, node has 995 blocks and has not yet run in prune mode node = self.nodes[node_number] = start_node( node_number, self.options.tmpdir, - ["-debug=0", "-blockmaxsize=1000000", "-uahfstarttime=%d" % UAHF_START_TIME], timewait=900) + ["-debug=0", "-blockmaxsize=1000000"], timewait=900) assert_equal(node.getblockcount(), 995) assert_raises_message( JSONRPCException, "not in prune mode", node.pruneblockchain, 500) @@ -320,7 +308,7 @@ # now re-start in manual pruning mode node = self.nodes[node_number] = start_node( node_number, self.options.tmpdir, - ["-debug=0", "-prune=1", "-blockmaxsize=1000000", "-uahfstarttime=%d" % UAHF_START_TIME], timewait=900) + ["-debug=0", "-prune=1", "-blockmaxsize=1000000"], timewait=900) assert_equal(node.getblockcount(), 995) def height(index): @@ -410,7 +398,7 @@ self.stop_node(node_number) self.nodes[node_number] = start_node( node_number, self.options.tmpdir, - ["-debug=0", "-prune=550", "-blockmaxsize=1000000", "-uahfstarttime=%d" % UAHF_START_TIME], timewait=900) + ["-debug=0", "-prune=550", "-blockmaxsize=1000000"], timewait=900) print("Success") @@ -421,8 +409,7 @@ self.stop_node(2) start_node(2, self.options.tmpdir, ["-debug=1", "-prune=550", - "-blockmaxsize=1000000", - "-uahfstarttime=%d" % UAHF_START_TIME]) + "-blockmaxsize=1000000"]) print("Success") except Exception as detail: raise AssertionError( @@ -438,8 +425,7 @@ self.stop_node(5) # stop and start to trigger rescan start_node(5, self.options.tmpdir, ["-debug=1", "-prune=550", - "-blockmaxsize=1000000", - "-uahfstarttime=%d" % UAHF_START_TIME]) + "-blockmaxsize=1000000"]) print ("Success") except Exception as detail: raise AssertionError("Wallet test: unable to re-start node5") diff --git a/qa/rpc-tests/rawtransactions.py b/qa/rpc-tests/rawtransactions.py --- a/qa/rpc-tests/rawtransactions.py +++ b/qa/rpc-tests/rawtransactions.py @@ -15,9 +15,6 @@ from test_framework.test_framework import BitcoinTestFramework from test_framework.util import * -# far in the past -UAHF_START_TIME = 30000000 - # Create one-input, one-output, no-fee transaction: @@ -29,9 +26,7 @@ self.num_nodes = 3 def setup_network(self, split=False): - self.nodes = start_nodes(self.num_nodes, self.options.tmpdir, - [["-uahfstarttime=%d" % UAHF_START_TIME] - for i in range(self.num_nodes)]) + self.nodes = start_nodes(self.num_nodes, self.options.tmpdir) # connect to a local machine for debugging # url = "http://bitcoinrpc:DP6DvqZtqXarpeNWyN3LZTFchCCyCUuHwNF7E8pX99x1@%s:%d" % ('127.0.0.1', 18332) diff --git a/qa/rpc-tests/receivedby.py b/qa/rpc-tests/receivedby.py --- a/qa/rpc-tests/receivedby.py +++ b/qa/rpc-tests/receivedby.py @@ -8,9 +8,6 @@ from test_framework.test_framework import BitcoinTestFramework from test_framework.util import * -# far in the past -UAHF_START_TIME = 30000000 - def get_sub_array_from_array(object_array, to_match): ''' @@ -38,8 +35,7 @@ def setup_nodes(self): # This test requires mocktime enable_mocktime() - return start_nodes(self.num_nodes, self.options.tmpdir, - [["-uahfstarttime=%d" % UAHF_START_TIME] for i in range(self.num_nodes)]) + return start_nodes(self.num_nodes, self.options.tmpdir) def run_test(self): ''' diff --git a/qa/rpc-tests/smartfees.py b/qa/rpc-tests/smartfees.py --- a/qa/rpc-tests/smartfees.py +++ b/qa/rpc-tests/smartfees.py @@ -12,9 +12,6 @@ from test_framework.util import * from test_framework.outputchecker import OutputChecker -# far in the past -UAHF_START_TIME = 30000000 - # Construct 2 trivial P2SH's and the ScriptSigs that spend them # So we can create many many transactions without needing to spend # time signing. @@ -174,8 +171,7 @@ # Use node0 to mine blocks for input splitting self.nodes.append( start_node(0, self.options.tmpdir, ["-maxorphantx=1000", - "-whitelist=127.0.0.1", - "-uahfstarttime=%d" % UAHF_START_TIME])) + "-whitelist=127.0.0.1"])) print("This test is time consuming, please be patient") print( @@ -216,17 +212,14 @@ # (17k is room enough for 110 or so transactions) self.nodes.append(start_node(1, self.options.tmpdir, ["-blockprioritysize=1500", "-blockmaxsize=17000", - "-maxorphantx=1000", "-debug=estimatefee", - "-uahfstarttime=%d" % UAHF_START_TIME], + "-maxorphantx=1000", "-debug=estimatefee"], stderr_checker=OutputChecker())) connect_nodes(self.nodes[1], 0) # Node2 is a stingy miner, that # produces too small blocks (room for only 55 or so transactions) node2args = ["-blockprioritysize=0", - "-blockmaxsize=8000", - "-maxorphantx=1000", - "-uahfstarttime=%d" % UAHF_START_TIME] + "-blockmaxsize=8000", "-maxorphantx=1000"] self.nodes.append( start_node(2, self.options.tmpdir, node2args, stderr_checker=OutputChecker())) diff --git a/qa/rpc-tests/test_framework/cdefs.py b/qa/rpc-tests/test_framework/cdefs.py --- a/qa/rpc-tests/test_framework/cdefs.py +++ b/qa/rpc-tests/test_framework/cdefs.py @@ -32,11 +32,6 @@ re.search(r'DEFAULT_MAX_BLOCK_SIZE = (.+);', _consensus_h_contents).group(1)) -# Start time is simple integer constant, so does not need evaluation. -DEFAULT_UAHF_START_TIME = int( - re.search(r'DEFAULT_UAHF_START_TIME = (.+);', - _consensus_h_contents).group(1)) - # The following consensus parameters should not be automatically imported. # They *should* cause test failures if application code is changed in ways # that violate current consensus. diff --git a/qa/rpc-tests/test_framework/test_framework.py b/qa/rpc-tests/test_framework/test_framework.py --- a/qa/rpc-tests/test_framework/test_framework.py +++ b/qa/rpc-tests/test_framework/test_framework.py @@ -30,10 +30,6 @@ from .outputchecker import OutputChecker -# far in the past -UAHF_START_TIME = 30000000 - - class BitcoinTestFramework(object): def __init__(self): @@ -62,7 +58,7 @@ ''' Starts up the nodes. ''' - return start_nodes(self.num_nodes, self.options.tmpdir, [["-uahfstarttime=%d" % UAHF_START_TIME] for i in range(self.num_nodes)]) + return start_nodes(self.num_nodes, self.options.tmpdir) def setup_network(self, split=False): ''' @@ -237,7 +233,6 @@ def setup_network(self): self.nodes = start_nodes( self.num_nodes, self.options.tmpdir, - extra_args=[ - ['-debug', '-whitelist=127.0.0.1', "-uahfstarttime=%d" % UAHF_START_TIME]] * self.num_nodes, + extra_args=[['-debug', '-whitelist=127.0.0.1']] * self.num_nodes, binary=[self.options.testbinary] + [self.options.refbinary] * (self.num_nodes - 1)) diff --git a/qa/rpc-tests/wallet.py b/qa/rpc-tests/wallet.py --- a/qa/rpc-tests/wallet.py +++ b/qa/rpc-tests/wallet.py @@ -6,9 +6,6 @@ from test_framework.test_framework import BitcoinTestFramework from test_framework.util import * -# far in the past -UAHF_START_TIME = 30000000 - class WalletTest (BitcoinTestFramework): @@ -22,9 +19,8 @@ super().__init__() self.setup_clean_chain = True self.num_nodes = 4 - self.extra_args = [['-usehd={:d}'.format(i % 2 == 0), - "-uahfstarttime=%d" % UAHF_START_TIME - ] for i in range(4)] + self.extra_args = [['-usehd={:d}'.format(i % 2 == 0)] + for i in range(4)] def setup_network(self, split=False): self.nodes = start_nodes(3, self.options.tmpdir, self.extra_args[:3]) @@ -216,8 +212,7 @@ # do some -walletbroadcast tests stop_nodes(self.nodes) - extra_args = [["-walletbroadcast=0", - "-uahfstarttime=%d" % UAHF_START_TIME] for i in range(3)] + extra_args = [["-walletbroadcast=0"] for i in range(3)] self.nodes = start_nodes(3, self.options.tmpdir, extra_args) connect_nodes_bi(self.nodes, 0, 1) connect_nodes_bi(self.nodes, 1, 2) @@ -248,9 +243,7 @@ # restart the nodes with -walletbroadcast=1 stop_nodes(self.nodes) - extra_args = [["-uahfstarttime=%d" % UAHF_START_TIME] - for i in range(3)] - self.nodes = start_nodes(3, self.options.tmpdir, extra_args) + self.nodes = start_nodes(3, self.options.tmpdir) connect_nodes_bi(self.nodes, 0, 1) connect_nodes_bi(self.nodes, 1, 2) connect_nodes_bi(self.nodes, 0, 2) @@ -366,9 +359,7 @@ stop_nodes(self.nodes) # set lower ancestor limit for later self.nodes = start_nodes(3, self.options.tmpdir, - [[m, - "-uahfstarttime=%d" % UAHF_START_TIME, - "-limitancestorcount=" + str(chainlimit)]] * 3) + [[m, "-limitancestorcount=" + str(chainlimit)]] * 3) while m == '-reindex' and [block_count] * 3 != [self.nodes[i].getblockcount() for i in range(3)]: # reindex will leave rpc warm up "early"; Wait for it to finish time.sleep(0.1) diff --git a/src/chainparams.cpp b/src/chainparams.cpp --- a/src/chainparams.cpp +++ b/src/chainparams.cpp @@ -140,6 +140,9 @@ uint256S("0x000000000000000002d8cae5936d502defc09c5ac317201a61955dd" "c8cdd950c"); + // Aug, 1 hard fork + consensus.uahfStartTime = 1501590000; + /** * The message start string is designed to be unlikely to occur in * normal data. The characters are rarely used upper ASCII, not valid as @@ -303,6 +306,9 @@ uint256S("0x0000000000000407b4c5a5d8204f05d584f1463004c8edea89376b1" "c52f7e1dd"); + // Aug, 1 hard fork + consensus.uahfStartTime = 1501590000; + pchMessageStart[0] = 0x0b; pchMessageStart[1] = 0x11; pchMessageStart[2] = 0x09; @@ -423,6 +429,9 @@ // valid. consensus.defaultAssumeValid = uint256S("0x00"); + // Hard fork is always enabled on regtest. + consensus.uahfStartTime = 0; + pchMessageStart[0] = 0xfa; pchMessageStart[1] = 0xbf; pchMessageStart[2] = 0xb5; diff --git a/src/config.h b/src/config.h --- a/src/config.h +++ b/src/config.h @@ -15,8 +15,6 @@ public: virtual bool SetMaxBlockSize(uint64_t maxBlockSize) = 0; virtual uint64_t GetMaxBlockSize() const = 0; - virtual bool SetUAHFStartTime(int64_t uahfStartTime) = 0; - virtual int64_t GetUAHFStartTime() const = 0; virtual const CChainParams &GetChainParams() const = 0; }; @@ -24,8 +22,6 @@ public: bool SetMaxBlockSize(uint64_t maxBlockSize); uint64_t GetMaxBlockSize() const; - bool SetUAHFStartTime(int64_t uahfStartTime); - int64_t GetUAHFStartTime() const; const CChainParams &GetChainParams() const; }; diff --git a/src/config.cpp b/src/config.cpp --- a/src/config.cpp +++ b/src/config.cpp @@ -22,15 +22,6 @@ return nMaxBlockSize; } -bool GlobalConfig::SetUAHFStartTime(int64_t uahfStartTime) { - nUAHFStartTime = uahfStartTime; - return true; -} - -int64_t GlobalConfig::GetUAHFStartTime() const { - return nUAHFStartTime; -} - const CChainParams &GlobalConfig::GetChainParams() const { return Params(); } diff --git a/src/consensus/consensus.h b/src/consensus/consensus.h --- a/src/consensus/consensus.h +++ b/src/consensus/consensus.h @@ -24,8 +24,6 @@ /** Coinbase transaction outputs can only be spent after this number of new * blocks (network rule) */ static const int COINBASE_MATURITY = 100; -/** Timestamp at which the UAHF starts. */ -static const uint64_t DEFAULT_UAHF_START_TIME = 1501590000; /** Flags for nSequence and nLockTime locks */ enum { diff --git a/src/consensus/params.h b/src/consensus/params.h --- a/src/consensus/params.h +++ b/src/consensus/params.h @@ -71,6 +71,9 @@ } uint256 nMinimumChainWork; uint256 defaultAssumeValid; + + /** The time at which UAHF starts. */ + int64_t uahfStartTime; }; } // namespace Consensus diff --git a/src/globals.h b/src/globals.h --- a/src/globals.h +++ b/src/globals.h @@ -9,7 +9,5 @@ /** The largest block size this node will accept. */ extern uint64_t nMaxBlockSize; -/** The timestamp at which UAHF starts. */ -extern int64_t nUAHFStartTime; #endif // BITCOIN_GLOBALS_H diff --git a/src/globals.cpp b/src/globals.cpp --- a/src/globals.cpp +++ b/src/globals.cpp @@ -7,4 +7,3 @@ #include "consensus/consensus.h" uint64_t nMaxBlockSize = DEFAULT_MAX_BLOCK_SIZE; -int64_t nUAHFStartTime = DEFAULT_UAHF_START_TIME; diff --git a/src/init.cpp b/src/init.cpp --- a/src/init.cpp +++ b/src/init.cpp @@ -854,13 +854,6 @@ DEFAULT_HTTP_SERVER_TIMEOUT)); } - strUsage += HelpMessageGroup(_("Hard Fork options:")); - strUsage += HelpMessageOpt( - "-uahfstarttime=", - strprintf(_("(Deprecated) UAHF activation (integer) " - "POSIX time, seconds since epoch (default: %u)"), - DEFAULT_UAHF_START_TIME)); - return strUsage; } @@ -1408,18 +1401,6 @@ return InitError(msg); } - const int64_t uahfFromArgs = - GetArg("-uahfstarttime", DEFAULT_UAHF_START_TIME); - if (uahfFromArgs != int64_t(DEFAULT_UAHF_START_TIME)) { - LogPrintf("WARNING: Deprecated use of -uahfstarttime=%d parameter\n", - uahfFromArgs); - } - if (!config.SetUAHFStartTime(uahfFromArgs)) { - return InitError(strprintf( - _("Unable to set uahfstarttime to the value (%d)"), uahfFromArgs)); - } - assert(config.GetUAHFStartTime() == uahfFromArgs); - // block pruning; get the amount of disk space (in MiB) to allot for block & // undo files int64_t nPruneArg = GetArg("-prune", 0); diff --git a/src/test/miner_tests.cpp b/src/test/miner_tests.cpp --- a/src/test/miner_tests.cpp +++ b/src/test/miner_tests.cpp @@ -725,7 +725,8 @@ LOCK(cs_main); // Activate UAHF - const int64_t hfStartTime = config.GetUAHFStartTime(); + const int64_t hfStartTime = + config.GetChainParams().GetConsensus().uahfStartTime; auto pindex = chainActive.Tip(); for (size_t i = 0; pindex && i < 5; i++) { pindex->nTime = hfStartTime; diff --git a/src/test/script_antireplay_tests.cpp b/src/test/script_antireplay_tests.cpp --- a/src/test/script_antireplay_tests.cpp +++ b/src/test/script_antireplay_tests.cpp @@ -74,7 +74,8 @@ // The anti replay rule start at hfStartTime and stops at // antiReplayOpReturnSunsetHeight. const int nSunsetHeight = params.antiReplayOpReturnSunsetHeight; - const int64_t nUAHFStartTime = config.GetUAHFStartTime(); + const int64_t nUAHFStartTime = + config.GetChainParams().GetConsensus().uahfStartTime; CMutableTransaction tx; tx.nVersion = 1; diff --git a/src/test/test_bitcoin.cpp b/src/test/test_bitcoin.cpp --- a/src/test/test_bitcoin.cpp +++ b/src/test/test_bitcoin.cpp @@ -50,7 +50,6 @@ // Set config parameters to default. GlobalConfig config; - config.SetUAHFStartTime(DEFAULT_UAHF_START_TIME); config.SetMaxBlockSize(DEFAULT_MAX_BLOCK_SIZE); } diff --git a/src/validation.cpp b/src/validation.cpp --- a/src/validation.cpp +++ b/src/validation.cpp @@ -602,7 +602,8 @@ } static bool IsUAHFenabled(const Config &config, int64_t nMedianTimePast) { - return nMedianTimePast >= config.GetUAHFStartTime(); + return nMedianTimePast >= + config.GetChainParams().GetConsensus().uahfStartTime; } bool IsUAHFenabled(const Config &config, const CBlockIndex *pindexPrev) {