Skip to content

Commit 2e6080b

Browse files
Remove unused variables and/or function calls
1 parent 9b94054 commit 2e6080b

18 files changed

+29
-360
lines changed

test/functional/bip68-sequence.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -387,7 +387,7 @@ def test_version2_relay(self):
387387
tx = FromHex(CTransaction(), rawtxfund)
388388
tx.nVersion = 2
389389
tx_signed = self.nodes[1].signrawtransaction(ToHex(tx))["hex"]
390-
tx_id = self.nodes[1].sendrawtransaction(tx_signed)
390+
self.nodes[1].sendrawtransaction(tx_signed)
391391

392392
if __name__ == '__main__':
393393
BIP68Test().main()

test/functional/bumpfee.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -167,7 +167,7 @@ def test_bumpfee_with_descendant_fails(rbf_node, rbf_node_address, dest_address)
167167
parent_id = spend_one_input(rbf_node, rbf_node_address)
168168
tx = rbf_node.createrawtransaction([{"txid": parent_id, "vout": 0}], {dest_address: 0.00020000})
169169
tx = rbf_node.signrawtransaction(tx)
170-
txid = rbf_node.sendrawtransaction(tx["hex"])
170+
rbf_node.sendrawtransaction(tx["hex"])
171171
assert_raises_jsonrpc(-8, "Transaction has descendants in the wallet", rbf_node.bumpfee, parent_id)
172172

173173

test/functional/fundrawtransaction.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -312,7 +312,6 @@ def run_test(self):
312312
##############################################
313313
# test a fundrawtransaction with invalid vin #
314314
##############################################
315-
listunspent = self.nodes[2].listunspent()
316315
inputs = [ {'txid' : "1c7f966dab21119bac53213a2bc7532bff1fa844c124fd750a7d0b1332440bd1", 'vout' : 0} ] #invalid vin!
317316
outputs = { self.nodes[0].getnewaddress() : 1.0}
318317
rawtx = self.nodes[2].createrawtransaction(inputs, outputs)

test/functional/import-rescan.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -161,7 +161,6 @@ def run_test(self):
161161
variant.check()
162162

163163
# Create new transactions sending to each address.
164-
fee = self.nodes[0].getnetworkinfo()["relayfee"]
165164
for i, variant in enumerate(IMPORT_VARIANTS):
166165
variant.sent_amount = 10 - (2 * i + 1) / 8.0
167166
variant.sent_txid = self.nodes[0].sendtoaddress(variant.address["address"], variant.sent_amount)

test/functional/importmulti.py

Lines changed: 0 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -21,16 +21,7 @@ def run_test (self):
2121
self.nodes[1].generate(1)
2222
timestamp = self.nodes[1].getblock(self.nodes[1].getbestblockhash())['mediantime']
2323

24-
# keyword definition
25-
PRIV_KEY = 'privkey'
26-
PUB_KEY = 'pubkey'
27-
ADDRESS_KEY = 'address'
28-
SCRIPT_KEY = 'script'
29-
30-
3124
node0_address1 = self.nodes[0].validateaddress(self.nodes[0].getnewaddress())
32-
node0_address2 = self.nodes[0].validateaddress(self.nodes[0].getnewaddress())
33-
node0_address3 = self.nodes[0].validateaddress(self.nodes[0].getnewaddress())
3425

3526
#Check only one address
3627
assert_equal(node0_address1['ismine'], True)
@@ -230,7 +221,6 @@ def run_test (self):
230221
transactionid = self.nodes[1].sendtoaddress(multi_sig_script['address'], 10.00)
231222
self.nodes[1].generate(1)
232223
timestamp = self.nodes[1].getblock(self.nodes[1].getbestblockhash())['mediantime']
233-
transaction = self.nodes[1].gettransaction(transactionid)
234224

235225
self.log.info("Should import a p2sh")
236226
result = self.nodes[1].importmulti([{
@@ -258,7 +248,6 @@ def run_test (self):
258248
transactionid = self.nodes[1].sendtoaddress(multi_sig_script['address'], 10.00)
259249
self.nodes[1].generate(1)
260250
timestamp = self.nodes[1].getblock(self.nodes[1].getbestblockhash())['mediantime']
261-
transaction = self.nodes[1].gettransaction(transactionid)
262251

263252
self.log.info("Should import a p2sh with respective redeem script")
264253
result = self.nodes[1].importmulti([{
@@ -286,7 +275,6 @@ def run_test (self):
286275
transactionid = self.nodes[1].sendtoaddress(multi_sig_script['address'], 10.00)
287276
self.nodes[1].generate(1)
288277
timestamp = self.nodes[1].getblock(self.nodes[1].getbestblockhash())['mediantime']
289-
transaction = self.nodes[1].gettransaction(transactionid)
290278

291279
self.log.info("Should import a p2sh with respective redeem script and private keys")
292280
result = self.nodes[1].importmulti([{
@@ -314,7 +302,6 @@ def run_test (self):
314302
transactionid = self.nodes[1].sendtoaddress(multi_sig_script['address'], 10.00)
315303
self.nodes[1].generate(1)
316304
timestamp = self.nodes[1].getblock(self.nodes[1].getbestblockhash())['mediantime']
317-
transaction = self.nodes[1].gettransaction(transactionid)
318305

319306
self.log.info("Should import a p2sh with respective redeem script and private keys")
320307
result = self.nodes[1].importmulti([{

test/functional/importprunedfunds.py

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,6 @@ def run_test(self):
2424
address1 = self.nodes[0].getnewaddress()
2525
# pubkey
2626
address2 = self.nodes[0].getnewaddress()
27-
address2_pubkey = self.nodes[0].validateaddress(address2)['pubkey'] # Using pubkey
2827
# privkey
2928
address3 = self.nodes[0].getnewaddress()
3029
address3_privkey = self.nodes[0].dumpprivkey(address3) # Using privkey
@@ -77,13 +76,13 @@ def run_test(self):
7776

7877
#Import with affiliated address with no rescan
7978
self.nodes[1].importaddress(address2, "add2", False)
80-
result2 = self.nodes[1].importprunedfunds(rawtxn2, proof2)
79+
self.nodes[1].importprunedfunds(rawtxn2, proof2)
8180
balance2 = self.nodes[1].getbalance("add2", 0, True)
8281
assert_equal(balance2, Decimal('0.05'))
8382

8483
#Import with private key with no rescan
8584
self.nodes[1].importprivkey(address3_privkey, "add3", False)
86-
result3 = self.nodes[1].importprunedfunds(rawtxn3, proof3)
85+
self.nodes[1].importprunedfunds(rawtxn3, proof3)
8786
balance3 = self.nodes[1].getbalance("add3", 0, False)
8887
assert_equal(balance3, Decimal('0.025'))
8988
balance3 = self.nodes[1].getbalance("*", 0, True)

test/functional/p2p-fullblocktest.py

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -397,7 +397,7 @@ def update_block(block_number, new_transactions):
397397
yield rejected(RejectResult(16, b'bad-cb-length'))
398398

399399
# Extend the b26 chain to make sure bitcoind isn't accepting b26
400-
b27 = block(27, spend=out[7])
400+
block(27, spend=out[7])
401401
yield rejected(False)
402402

403403
# Now try a too-large-coinbase script
@@ -409,7 +409,7 @@ def update_block(block_number, new_transactions):
409409
yield rejected(RejectResult(16, b'bad-cb-length'))
410410

411411
# Extend the b28 chain to make sure bitcoind isn't accepting b28
412-
b29 = block(29, spend=out[7])
412+
block(29, spend=out[7])
413413
yield rejected(False)
414414

415415
# b30 has a max-sized coinbase scriptSig.
@@ -581,7 +581,7 @@ def update_block(block_number, new_transactions):
581581

582582
# same as b40, but one less sigop
583583
tip(39)
584-
b41 = block(41, spend=None)
584+
block(41, spend=None)
585585
update_block(41, b40.vtx[1:-1])
586586
b41_sigops_to_fill = b40_sigops_to_fill - 1
587587
tx = CTransaction()
@@ -927,7 +927,7 @@ def update_block(block_number, new_transactions):
927927
# -> b42 (12) -> b43 (13) -> b53 (14) -> b55 (15) -> b57 (16) -> b60 (17) -> b64 (18) -> b65 (19)
928928
#
929929
tip(64)
930-
b65 = block(65)
930+
block(65)
931931
tx1 = create_and_sign_tx(out[19].tx, out[19].n, out[19].tx.vout[0].nValue)
932932
tx2 = create_and_sign_tx(tx1, 0, 0)
933933
update_block(65, [tx1, tx2])
@@ -939,7 +939,7 @@ def update_block(block_number, new_transactions):
939939
# -> b43 (13) -> b53 (14) -> b55 (15) -> b57 (16) -> b60 (17) -> b64 (18) -> b65 (19)
940940
# \-> b66 (20)
941941
tip(65)
942-
b66 = block(66)
942+
block(66)
943943
tx1 = create_and_sign_tx(out[20].tx, out[20].n, out[20].tx.vout[0].nValue)
944944
tx2 = create_and_sign_tx(tx1, 0, 1)
945945
update_block(66, [tx2, tx1])
@@ -952,7 +952,7 @@ def update_block(block_number, new_transactions):
952952
#
953953
#
954954
tip(65)
955-
b67 = block(67)
955+
block(67)
956956
tx1 = create_and_sign_tx(out[20].tx, out[20].n, out[20].tx.vout[0].nValue)
957957
tx2 = create_and_sign_tx(tx1, 0, 1)
958958
tx3 = create_and_sign_tx(tx1, 0, 2)
@@ -972,7 +972,7 @@ def update_block(block_number, new_transactions):
972972
# this succeeds
973973
#
974974
tip(65)
975-
b68 = block(68, additional_coinbase_value=10)
975+
block(68, additional_coinbase_value=10)
976976
tx = create_and_sign_tx(out[20].tx, out[20].n, out[20].tx.vout[0].nValue-9)
977977
update_block(68, [tx])
978978
yield rejected(RejectResult(16, b'bad-cb-amount'))
@@ -1175,7 +1175,7 @@ def update_block(block_number, new_transactions):
11751175
#
11761176
# -> b81 (26) -> b82 (27) -> b83 (28)
11771177
#
1178-
b83 = block(83)
1178+
block(83)
11791179
op_codes = [OP_IF, OP_INVALIDOPCODE, OP_ELSE, OP_TRUE, OP_ENDIF]
11801180
script = CScript(op_codes)
11811181
tx1 = create_and_sign_tx(out[28].tx, out[28].n, out[28].tx.vout[0].nValue, script)
@@ -1195,7 +1195,7 @@ def update_block(block_number, new_transactions):
11951195
# \-> b85 (29) -> b86 (30) \-> b89a (32)
11961196
#
11971197
#
1198-
b84 = block(84)
1198+
block(84)
11991199
tx1 = create_tx(out[29].tx, out[29].n, 0, CScript([OP_RETURN]))
12001200
tx1.vout.append(CTxOut(0, CScript([OP_TRUE])))
12011201
tx1.vout.append(CTxOut(0, CScript([OP_TRUE])))

test/functional/p2p-segwit.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,6 @@
1717
# The versionbit bit used to signal activation of SegWit
1818
VB_WITNESS_BIT = 1
1919
VB_PERIOD = 144
20-
VB_ACTIVATION_THRESHOLD = 108
2120
VB_TOP_BITS = 0x20000000
2221

2322
MAX_SIGOP_COST = 80000

test/functional/rawtransactions.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,6 @@ def run_test(self):
6363
addr2Obj = self.nodes[2].validateaddress(addr2)
6464

6565
mSigObj = self.nodes[2].addmultisigaddress(2, [addr1Obj['pubkey'], addr2Obj['pubkey']])
66-
mSigObjValid = self.nodes[2].validateaddress(mSigObj)
6766

6867
#use balance deltas instead of absolute values
6968
bal = self.nodes[2].getbalance()
@@ -87,7 +86,6 @@ def run_test(self):
8786
addr3Obj = self.nodes[2].validateaddress(addr3)
8887

8988
mSigObj = self.nodes[2].addmultisigaddress(2, [addr1Obj['pubkey'], addr2Obj['pubkey'], addr3Obj['pubkey']])
90-
mSigObjValid = self.nodes[2].validateaddress(mSigObj)
9189

9290
txId = self.nodes[0].sendtoaddress(mSigObj, 2.2)
9391
decTx = self.nodes[0].gettransaction(txId)

test/functional/replace-by-fee.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -270,7 +270,7 @@ def test_replacement_feeperkb(self):
270270
tx1a.vin = [CTxIn(tx0_outpoint, nSequence=0)]
271271
tx1a.vout = [CTxOut(1*COIN, CScript([b'a']))]
272272
tx1a_hex = txToHex(tx1a)
273-
tx1a_txid = self.nodes[0].sendrawtransaction(tx1a_hex, True)
273+
self.nodes[0].sendrawtransaction(tx1a_hex, True)
274274

275275
# Higher fee, but the fee per KB is much lower, so the replacement is
276276
# rejected.
@@ -331,7 +331,7 @@ def test_new_unconfirmed_inputs(self):
331331
tx1.vin = [CTxIn(confirmed_utxo)]
332332
tx1.vout = [CTxOut(1*COIN, CScript([b'a']))]
333333
tx1_hex = txToHex(tx1)
334-
tx1_txid = self.nodes[0].sendrawtransaction(tx1_hex, True)
334+
self.nodes[0].sendrawtransaction(tx1_hex, True)
335335

336336
tx2 = CTransaction()
337337
tx2.vin = [CTxIn(confirmed_utxo), CTxIn(unconfirmed_utxo)]
@@ -499,7 +499,7 @@ def test_prioritised_transactions(self):
499499
tx2a.vin = [CTxIn(tx1_outpoint, nSequence=0)]
500500
tx2a.vout = [CTxOut(1*COIN, CScript([b'a']))]
501501
tx2a_hex = txToHex(tx2a)
502-
tx2a_txid = self.nodes[0].sendrawtransaction(tx2a_hex, True)
502+
self.nodes[0].sendrawtransaction(tx2a_hex, True)
503503

504504
# Lower fee, but we'll prioritise it
505505
tx2b = CTransaction()

0 commit comments

Comments
 (0)