@@ -41,24 +41,17 @@ def assert_approximate(a, b):
41
41
BTC = Decimal ('100000000' )
42
42
43
43
class PriorityTest (BitcoinTestFramework ):
44
+ def add_options (self , parser ):
45
+ self .add_wallet_options (parser )
44
46
45
47
def set_test_params (self ):
46
48
self .num_nodes = 3
47
49
self .testmsg_num = 0
48
50
49
- def add_options (self , parser ):
50
- self .add_wallet_options (parser )
51
- parser .add_argument ("--gbt" , dest = "test_gbt" , default = False , action = "store_true" ,
52
- help = "Test priorities used by GBT" )
53
-
54
51
def setup_nodes (self ):
55
- ppopt = []
56
- if self .options .test_gbt :
57
- ppopt .append ('-printpriority' )
58
-
59
52
self .extra_args = [
60
53
['-blockmaxsize=0' ],
61
- ['-blockprioritysize=1000000' , '-blockmaxsize=1000000' ] + ppopt ,
54
+ ['-blockprioritysize=1000000' , '-blockmaxsize=1000000' , '-printpriority' ] ,
62
55
['-blockmaxsize=0' ],
63
56
]
64
57
@@ -67,19 +60,18 @@ def setup_nodes(self):
67
60
def assert_prio (self , txid , starting , current ):
68
61
node = self .nodes [1 ]
69
62
70
- if self .options .test_gbt :
71
- tmpl = node .getblocktemplate ({'rules' :('segwit' ,)})
72
- tmplentry = None
73
- for tx in tmpl ['transactions' ]:
74
- if tx ['txid' ] == txid :
75
- tmplentry = tx
76
- break
77
- # GBT does not expose starting priority, so we don't check that
78
- assert_approximate (tmplentry ['priority' ], current )
79
- else :
80
- mempoolentry = node .getrawmempool (True )[txid ]
81
- assert_approximate (mempoolentry ['startingpriority' ], starting )
82
- assert_approximate (mempoolentry ['currentpriority' ], current )
63
+ tmpl = node .getblocktemplate ({'rules' :('segwit' ,)})
64
+ tmplentry = None
65
+ for tx in tmpl ['transactions' ]:
66
+ if tx ['txid' ] == txid :
67
+ tmplentry = tx
68
+ break
69
+ # GBT does not expose starting priority, so we don't check that
70
+ assert_approximate (tmplentry ['priority' ], current )
71
+
72
+ mempoolentry = node .getrawmempool (True )[txid ]
73
+ assert_approximate (mempoolentry ['startingpriority' ], starting )
74
+ assert_approximate (mempoolentry ['currentpriority' ], current )
83
75
84
76
def testmsg (self , msg ):
85
77
self .testmsg_num += 1
0 commit comments