@@ -83,7 +83,7 @@ def test_basic_child_then_parent(self):
83
83
peer_sender = node .add_p2p_connection (P2PInterface ())
84
84
85
85
# 1. Child is received first (perhaps the low feerate parent didn't meet feefilter or the requests were sent to different nodes). It is missing an input.
86
- high_child_wtxid_int = int ( high_fee_child ["tx" ].wtxid_hex , 16 )
86
+ high_child_wtxid_int = high_fee_child ["tx" ].wtxid_int
87
87
peer_sender .send_and_ping (msg_inv ([CInv (t = MSG_WTX , h = high_child_wtxid_int )]))
88
88
peer_sender .wait_for_getdata ([high_child_wtxid_int ])
89
89
peer_sender .send_and_ping (msg_tx (high_fee_child ["tx" ]))
@@ -112,7 +112,7 @@ def test_basic_parent_then_child(self, wallet):
112
112
peer_ignored = node .add_outbound_p2p_connection (P2PInterface (), p2p_idx = 2 , connection_type = "outbound-full-relay" )
113
113
114
114
# 1. Parent is relayed first. It is too low feerate.
115
- parent_wtxid_int = int ( low_fee_parent ["tx" ].wtxid_hex , 16 )
115
+ parent_wtxid_int = low_fee_parent ["tx" ].wtxid_int
116
116
peer_sender .send_and_ping (msg_inv ([CInv (t = MSG_WTX , h = parent_wtxid_int )]))
117
117
peer_sender .wait_for_getdata ([parent_wtxid_int ])
118
118
peer_sender .send_and_ping (msg_tx (low_fee_parent ["tx" ]))
@@ -123,7 +123,7 @@ def test_basic_parent_then_child(self, wallet):
123
123
assert "getdata" not in peer_ignored .last_message
124
124
125
125
# 2. Child is relayed next. It is missing an input.
126
- high_child_wtxid_int = int ( high_fee_child ["tx" ].wtxid_hex , 16 )
126
+ high_child_wtxid_int = high_fee_child ["tx" ].wtxid_int
127
127
peer_sender .send_and_ping (msg_inv ([CInv (t = MSG_WTX , h = high_child_wtxid_int )]))
128
128
peer_sender .wait_for_getdata ([high_child_wtxid_int ])
129
129
peer_sender .send_and_ping (msg_tx (high_fee_child ["tx" ]))
@@ -156,7 +156,7 @@ def test_low_and_high_child(self, wallet):
156
156
self .log .info ("Check that tx caches low fee parent + low fee child package rejections" )
157
157
158
158
# 1. Send parent, rejected for being low feerate.
159
- parent_wtxid_int = int ( low_fee_parent ["tx" ].wtxid_hex , 16 )
159
+ parent_wtxid_int = low_fee_parent ["tx" ].wtxid_int
160
160
peer_sender .send_and_ping (msg_inv ([CInv (t = MSG_WTX , h = parent_wtxid_int )]))
161
161
peer_sender .wait_for_getdata ([parent_wtxid_int ])
162
162
peer_sender .send_and_ping (msg_tx (low_fee_parent ["tx" ]))
@@ -167,7 +167,7 @@ def test_low_and_high_child(self, wallet):
167
167
assert "getdata" not in peer_ignored .last_message
168
168
169
169
# 2. Send an (orphan) child that has a higher feerate, but not enough to bump the parent.
170
- med_child_wtxid_int = int ( med_fee_child ["tx" ].wtxid_hex , 16 )
170
+ med_child_wtxid_int = med_fee_child ["tx" ].wtxid_int
171
171
peer_sender .send_and_ping (msg_inv ([CInv (t = MSG_WTX , h = med_child_wtxid_int )]))
172
172
peer_sender .wait_for_getdata ([med_child_wtxid_int ])
173
173
peer_sender .send_and_ping (msg_tx (med_fee_child ["tx" ]))
@@ -193,7 +193,7 @@ def test_low_and_high_child(self, wallet):
193
193
assert med_fee_child ["txid" ] not in node .getrawmempool ()
194
194
195
195
# 5. Send the high feerate (orphan) child
196
- high_child_wtxid_int = int ( high_fee_child ["tx" ].wtxid_hex , 16 )
196
+ high_child_wtxid_int = high_fee_child ["tx" ].wtxid_int
197
197
peer_sender .send_and_ping (msg_inv ([CInv (t = MSG_WTX , h = high_child_wtxid_int )]))
198
198
peer_sender .wait_for_getdata ([high_child_wtxid_int ])
199
199
peer_sender .send_and_ping (msg_tx (high_fee_child ["tx" ]))
@@ -229,7 +229,7 @@ def test_orphan_consensus_failure(self):
229
229
parent_sender = node .add_p2p_connection (P2PInterface ())
230
230
231
231
# 1. Child is received first. It is missing an input.
232
- child_wtxid_int = int ( tx_orphan_bad_wit .wtxid_hex , 16 )
232
+ child_wtxid_int = tx_orphan_bad_wit .wtxid_int
233
233
bad_orphan_sender .send_and_ping (msg_inv ([CInv (t = MSG_WTX , h = child_wtxid_int )]))
234
234
bad_orphan_sender .wait_for_getdata ([child_wtxid_int ])
235
235
bad_orphan_sender .send_and_ping (msg_tx (tx_orphan_bad_wit ))
@@ -270,13 +270,13 @@ def test_parent_consensus_failure(self):
270
270
fake_parent_sender = node .add_p2p_connection (P2PInterface ())
271
271
272
272
# 1. Child is received first. It is missing an input.
273
- child_wtxid_int = int ( high_fee_child ["tx" ].wtxid_hex , 16 )
273
+ child_wtxid_int = high_fee_child ["tx" ].wtxid_int
274
274
package_sender .send_and_ping (msg_inv ([CInv (t = MSG_WTX , h = child_wtxid_int )]))
275
275
package_sender .wait_for_getdata ([child_wtxid_int ])
276
276
package_sender .send_and_ping (msg_tx (high_fee_child ["tx" ]))
277
277
278
278
# 2. Node requests the missing parent by txid.
279
- parent_txid_int = int ( tx_parent_bad_wit .txid_hex , 16 )
279
+ parent_txid_int = tx_parent_bad_wit .txid_int
280
280
package_sender .wait_for_getdata ([parent_txid_int ])
281
281
282
282
# 3. A different node relays the parent. The parent is first evaluated by itself and
@@ -292,7 +292,7 @@ def test_parent_consensus_failure(self):
292
292
self .log .info ("Check that fake parent does not cause orphan to be deleted and real package can still be submitted" )
293
293
# 5. Child-sending should not have been punished and the orphan should remain in orphanage.
294
294
# It can send the "real" parent transaction, and the package is accepted.
295
- parent_wtxid_int = int ( low_fee_parent ["tx" ].wtxid_hex , 16 )
295
+ parent_wtxid_int = low_fee_parent ["tx" ].wtxid_int
296
296
package_sender .send_and_ping (msg_inv ([CInv (t = MSG_WTX , h = parent_wtxid_int )]))
297
297
package_sender .wait_for_getdata ([parent_wtxid_int ])
298
298
package_sender .send_and_ping (msg_tx (low_fee_parent ["tx" ]))
0 commit comments