@@ -123,7 +123,7 @@ def test_simple_doublespend(self):
123
123
124
124
tx1a = CTransaction ()
125
125
tx1a .vin = [CTxIn (tx0_outpoint , nSequence = 0 )]
126
- tx1a .vout = [CTxOut (1 * COIN , CScript ([b'a' ]))]
126
+ tx1a .vout = [CTxOut (1 * COIN , CScript ([b'a' * 35 ]))]
127
127
tx1a_hex = txToHex (tx1a )
128
128
tx1a_txid = self .nodes [0 ].sendrawtransaction (tx1a_hex , True )
129
129
@@ -132,7 +132,7 @@ def test_simple_doublespend(self):
132
132
# Should fail because we haven't changed the fee
133
133
tx1b = CTransaction ()
134
134
tx1b .vin = [CTxIn (tx0_outpoint , nSequence = 0 )]
135
- tx1b .vout = [CTxOut (1 * COIN , CScript ([b'b' ]))]
135
+ tx1b .vout = [CTxOut (1 * COIN , CScript ([b'b' * 35 ]))]
136
136
tx1b_hex = txToHex (tx1b )
137
137
138
138
# This will raise an exception due to insufficient fee
@@ -143,7 +143,7 @@ def test_simple_doublespend(self):
143
143
# Extra 0.1 BTC fee
144
144
tx1b = CTransaction ()
145
145
tx1b .vin = [CTxIn (tx0_outpoint , nSequence = 0 )]
146
- tx1b .vout = [CTxOut (int (0.9 * COIN ), CScript ([b'b' ]))]
146
+ tx1b .vout = [CTxOut (int (0.9 * COIN ), CScript ([b'b' * 35 ]))]
147
147
tx1b_hex = txToHex (tx1b )
148
148
# Replacement still disabled even with "enough fee"
149
149
assert_raises_rpc_error (- 26 , "txn-mempool-conflict" , self .nodes [1 ].sendrawtransaction , tx1b_hex , True )
@@ -175,7 +175,7 @@ def test_doublespend_chain(self):
175
175
remaining_value -= 1 * COIN
176
176
tx = CTransaction ()
177
177
tx .vin = [CTxIn (prevout , nSequence = 0 )]
178
- tx .vout = [CTxOut (remaining_value , CScript ([1 ]))]
178
+ tx .vout = [CTxOut (remaining_value , CScript ([1 , OP_DROP ] * 15 + [ 1 ]))]
179
179
tx_hex = txToHex (tx )
180
180
txid = self .nodes [0 ].sendrawtransaction (tx_hex , True )
181
181
chain_txids .append (txid )
@@ -185,7 +185,7 @@ def test_doublespend_chain(self):
185
185
# child fees - 40 BTC - so this attempt is rejected.
186
186
dbl_tx = CTransaction ()
187
187
dbl_tx .vin = [CTxIn (tx0_outpoint , nSequence = 0 )]
188
- dbl_tx .vout = [CTxOut (initial_nValue - 30 * COIN , CScript ([1 ]))]
188
+ dbl_tx .vout = [CTxOut (initial_nValue - 30 * COIN , CScript ([1 ] * 35 ))]
189
189
dbl_tx_hex = txToHex (dbl_tx )
190
190
191
191
# This will raise an exception due to insufficient fee
@@ -194,7 +194,7 @@ def test_doublespend_chain(self):
194
194
# Accepted with sufficient fee
195
195
dbl_tx = CTransaction ()
196
196
dbl_tx .vin = [CTxIn (tx0_outpoint , nSequence = 0 )]
197
- dbl_tx .vout = [CTxOut (1 * COIN , CScript ([1 ]))]
197
+ dbl_tx .vout = [CTxOut (1 * COIN , CScript ([1 ] * 35 ))]
198
198
dbl_tx_hex = txToHex (dbl_tx )
199
199
self .nodes [0 ].sendrawtransaction (dbl_tx_hex , True )
200
200
@@ -247,15 +247,15 @@ def branch(prevout, initial_value, max_txs, tree_width=5, fee=0.0001*COIN, _tota
247
247
# Attempt double-spend, will fail because too little fee paid
248
248
dbl_tx = CTransaction ()
249
249
dbl_tx .vin = [CTxIn (tx0_outpoint , nSequence = 0 )]
250
- dbl_tx .vout = [CTxOut (initial_nValue - fee * n , CScript ([1 ]))]
250
+ dbl_tx .vout = [CTxOut (initial_nValue - fee * n , CScript ([1 ] * 35 ))]
251
251
dbl_tx_hex = txToHex (dbl_tx )
252
252
# This will raise an exception due to insufficient fee
253
253
assert_raises_rpc_error (- 26 , "insufficient fee" , self .nodes [0 ].sendrawtransaction , dbl_tx_hex , True )
254
254
255
255
# 1 BTC fee is enough
256
256
dbl_tx = CTransaction ()
257
257
dbl_tx .vin = [CTxIn (tx0_outpoint , nSequence = 0 )]
258
- dbl_tx .vout = [CTxOut (initial_nValue - fee * n - 1 * COIN , CScript ([1 ]))]
258
+ dbl_tx .vout = [CTxOut (initial_nValue - fee * n - 1 * COIN , CScript ([1 ] * 35 ))]
259
259
dbl_tx_hex = txToHex (dbl_tx )
260
260
self .nodes [0 ].sendrawtransaction (dbl_tx_hex , True )
261
261
@@ -275,7 +275,7 @@ def branch(prevout, initial_value, max_txs, tree_width=5, fee=0.0001*COIN, _tota
275
275
276
276
dbl_tx = CTransaction ()
277
277
dbl_tx .vin = [CTxIn (tx0_outpoint , nSequence = 0 )]
278
- dbl_tx .vout = [CTxOut (initial_nValue - 2 * fee * n , CScript ([1 ]))]
278
+ dbl_tx .vout = [CTxOut (initial_nValue - 2 * fee * n , CScript ([1 ] * 35 ))]
279
279
dbl_tx_hex = txToHex (dbl_tx )
280
280
# This will raise an exception
281
281
assert_raises_rpc_error (- 26 , "too many potential replacements" , self .nodes [0 ].sendrawtransaction , dbl_tx_hex , True )
@@ -290,7 +290,7 @@ def test_replacement_feeperkb(self):
290
290
291
291
tx1a = CTransaction ()
292
292
tx1a .vin = [CTxIn (tx0_outpoint , nSequence = 0 )]
293
- tx1a .vout = [CTxOut (1 * COIN , CScript ([b'a' ]))]
293
+ tx1a .vout = [CTxOut (1 * COIN , CScript ([b'a' * 35 ]))]
294
294
tx1a_hex = txToHex (tx1a )
295
295
self .nodes [0 ].sendrawtransaction (tx1a_hex , True )
296
296
@@ -311,7 +311,7 @@ def test_spends_of_conflicting_outputs(self):
311
311
312
312
tx1a = CTransaction ()
313
313
tx1a .vin = [CTxIn (utxo1 , nSequence = 0 )]
314
- tx1a .vout = [CTxOut (int (1.1 * COIN ), CScript ([b'a' ]))]
314
+ tx1a .vout = [CTxOut (int (1.1 * COIN ), CScript ([b'a' * 35 ]))]
315
315
tx1a_hex = txToHex (tx1a )
316
316
tx1a_txid = self .nodes [0 ].sendrawtransaction (tx1a_hex , True )
317
317
@@ -330,7 +330,7 @@ def test_spends_of_conflicting_outputs(self):
330
330
# Spend tx1a's output to test the indirect case.
331
331
tx1b = CTransaction ()
332
332
tx1b .vin = [CTxIn (COutPoint (tx1a_txid , 0 ), nSequence = 0 )]
333
- tx1b .vout = [CTxOut (1 * COIN , CScript ([b'a' ]))]
333
+ tx1b .vout = [CTxOut (1 * COIN , CScript ([b'a' * 35 ]))]
334
334
tx1b_hex = txToHex (tx1b )
335
335
tx1b_txid = self .nodes [0 ].sendrawtransaction (tx1b_hex , True )
336
336
tx1b_txid = int (tx1b_txid , 16 )
@@ -351,7 +351,7 @@ def test_new_unconfirmed_inputs(self):
351
351
352
352
tx1 = CTransaction ()
353
353
tx1 .vin = [CTxIn (confirmed_utxo )]
354
- tx1 .vout = [CTxOut (1 * COIN , CScript ([b'a' ]))]
354
+ tx1 .vout = [CTxOut (1 * COIN , CScript ([b'a' * 35 ]))]
355
355
tx1_hex = txToHex (tx1 )
356
356
self .nodes [0 ].sendrawtransaction (tx1_hex , True )
357
357
@@ -390,7 +390,7 @@ def test_too_many_replacements(self):
390
390
for i in range (MAX_REPLACEMENT_LIMIT + 1 ):
391
391
tx_i = CTransaction ()
392
392
tx_i .vin = [CTxIn (COutPoint (txid , i ), nSequence = 0 )]
393
- tx_i .vout = [CTxOut (split_value - fee , CScript ([b'a' ]))]
393
+ tx_i .vout = [CTxOut (split_value - fee , CScript ([b'a' * 35 ]))]
394
394
tx_i_hex = txToHex (tx_i )
395
395
self .nodes [0 ].sendrawtransaction (tx_i_hex , True )
396
396
@@ -423,14 +423,14 @@ def test_opt_in(self):
423
423
# Create a non-opting in transaction
424
424
tx1a = CTransaction ()
425
425
tx1a .vin = [CTxIn (tx0_outpoint , nSequence = 0xffffffff )]
426
- tx1a .vout = [CTxOut (1 * COIN , CScript ([b'a' ]))]
426
+ tx1a .vout = [CTxOut (1 * COIN , CScript ([b'a' * 35 ]))]
427
427
tx1a_hex = txToHex (tx1a )
428
428
tx1a_txid = self .nodes [0 ].sendrawtransaction (tx1a_hex , True )
429
429
430
430
# Shouldn't be able to double-spend
431
431
tx1b = CTransaction ()
432
432
tx1b .vin = [CTxIn (tx0_outpoint , nSequence = 0 )]
433
- tx1b .vout = [CTxOut (int (0.9 * COIN ), CScript ([b'b' ]))]
433
+ tx1b .vout = [CTxOut (int (0.9 * COIN ), CScript ([b'b' * 35 ]))]
434
434
tx1b_hex = txToHex (tx1b )
435
435
436
436
# This will raise an exception
@@ -441,14 +441,14 @@ def test_opt_in(self):
441
441
# Create a different non-opting in transaction
442
442
tx2a = CTransaction ()
443
443
tx2a .vin = [CTxIn (tx1_outpoint , nSequence = 0xfffffffe )]
444
- tx2a .vout = [CTxOut (1 * COIN , CScript ([b'a' ]))]
444
+ tx2a .vout = [CTxOut (1 * COIN , CScript ([b'a' * 35 ]))]
445
445
tx2a_hex = txToHex (tx2a )
446
446
tx2a_txid = self .nodes [0 ].sendrawtransaction (tx2a_hex , True )
447
447
448
448
# Still shouldn't be able to double-spend
449
449
tx2b = CTransaction ()
450
450
tx2b .vin = [CTxIn (tx1_outpoint , nSequence = 0 )]
451
- tx2b .vout = [CTxOut (int (0.9 * COIN ), CScript ([b'b' ]))]
451
+ tx2b .vout = [CTxOut (int (0.9 * COIN ), CScript ([b'b' * 35 ]))]
452
452
tx2b_hex = txToHex (tx2b )
453
453
454
454
# This will raise an exception
@@ -471,12 +471,12 @@ def test_opt_in(self):
471
471
472
472
tx3b = CTransaction ()
473
473
tx3b .vin = [CTxIn (COutPoint (tx1a_txid , 0 ), nSequence = 0 )]
474
- tx3b .vout = [CTxOut (int (0.5 * COIN ), CScript ([b'e' ]))]
474
+ tx3b .vout = [CTxOut (int (0.5 * COIN ), CScript ([b'e' * 35 ]))]
475
475
tx3b_hex = txToHex (tx3b )
476
476
477
477
tx3c = CTransaction ()
478
478
tx3c .vin = [CTxIn (COutPoint (tx2a_txid , 0 ), nSequence = 0 )]
479
- tx3c .vout = [CTxOut (int (0.5 * COIN ), CScript ([b'f' ]))]
479
+ tx3c .vout = [CTxOut (int (0.5 * COIN ), CScript ([b'f' * 35 ]))]
480
480
tx3c_hex = txToHex (tx3c )
481
481
482
482
self .nodes [0 ].sendrawtransaction (tx3b_hex , True )
@@ -493,7 +493,7 @@ def test_prioritised_transactions(self):
493
493
494
494
tx1a = CTransaction ()
495
495
tx1a .vin = [CTxIn (tx0_outpoint , nSequence = 0 )]
496
- tx1a .vout = [CTxOut (1 * COIN , CScript ([b'a' ]))]
496
+ tx1a .vout = [CTxOut (1 * COIN , CScript ([b'a' * 35 ]))]
497
497
tx1a_hex = txToHex (tx1a )
498
498
tx1a_txid = self .nodes [0 ].sendrawtransaction (tx1a_hex , True )
499
499
@@ -519,14 +519,14 @@ def test_prioritised_transactions(self):
519
519
520
520
tx2a = CTransaction ()
521
521
tx2a .vin = [CTxIn (tx1_outpoint , nSequence = 0 )]
522
- tx2a .vout = [CTxOut (1 * COIN , CScript ([b'a' ]))]
522
+ tx2a .vout = [CTxOut (1 * COIN , CScript ([b'a' * 35 ]))]
523
523
tx2a_hex = txToHex (tx2a )
524
524
self .nodes [0 ].sendrawtransaction (tx2a_hex , True )
525
525
526
526
# Lower fee, but we'll prioritise it
527
527
tx2b = CTransaction ()
528
528
tx2b .vin = [CTxIn (tx1_outpoint , nSequence = 0 )]
529
- tx2b .vout = [CTxOut (int (1.01 * COIN ), CScript ([b'a' ]))]
529
+ tx2b .vout = [CTxOut (int (1.01 * COIN ), CScript ([b'a' * 35 ]))]
530
530
tx2b .rehash ()
531
531
tx2b_hex = txToHex (tx2b )
532
532
0 commit comments