Browse Source

Merge #9532: Remove unused variables

90fd29b Remove unused int64_t nSinceLastSeen (practicalswift)
ac4a095 Remove unused Python variables (practicalswift)
0.14
Wladimir J. van der Laan 8 years ago
parent
commit
b709fe7ffc
No known key found for this signature in database
GPG Key ID: 74810B012346C9A6
  1. 1
      contrib/testgen/base58.py
  2. 1
      contrib/testgen/gen_base58_test_vectors.py
  3. 2
      qa/rpc-tests/forknotify.py
  4. 1
      qa/rpc-tests/p2p-segwit.py
  5. 3
      qa/rpc-tests/receivedby.py
  6. 1
      qa/rpc-tests/replace-by-fee.py
  7. 1
      qa/rpc-tests/wallet.py
  8. 3
      src/addrman.cpp

1
contrib/testgen/base58.py

@ -84,7 +84,6 @@ def b58decode_chk(v):
result = b58decode(v) result = b58decode(v)
if result is None: if result is None:
return None return None
h3 = checksum(result[:-4])
if result[-4:] == checksum(result[:-4]): if result[-4:] == checksum(result[:-4]):
return result[:-4] return result[:-4]
else: else:

1
contrib/testgen/gen_base58_test_vectors.py

@ -45,7 +45,6 @@ def is_valid(v):
result = b58decode_chk(v) result = b58decode_chk(v)
if result is None: if result is None:
return False return False
valid = False
for template in templates: for template in templates:
prefix = str(bytearray(template[0])) prefix = str(bytearray(template[0]))
suffix = str(bytearray(template[2])) suffix = str(bytearray(template[2]))

2
qa/rpc-tests/forknotify.py

@ -22,7 +22,7 @@ class ForkNotifyTest(BitcoinTestFramework):
def setup_network(self): def setup_network(self):
self.nodes = [] self.nodes = []
self.alert_filename = os.path.join(self.options.tmpdir, "alert.txt") self.alert_filename = os.path.join(self.options.tmpdir, "alert.txt")
with open(self.alert_filename, 'w', encoding='utf8') as f: with open(self.alert_filename, 'w', encoding='utf8'):
pass # Just open then close to create zero-length file pass # Just open then close to create zero-length file
self.nodes.append(start_node(0, self.options.tmpdir, self.nodes.append(start_node(0, self.options.tmpdir,
["-blockversion=2", "-alertnotify=echo %s >> \"" + self.alert_filename + "\""])) ["-blockversion=2", "-alertnotify=echo %s >> \"" + self.alert_filename + "\""]))

1
qa/rpc-tests/p2p-segwit.py

@ -951,7 +951,6 @@ class SegWitTest(BitcoinTestFramework):
tx.rehash() tx.rehash()
tx_hash = tx.sha256 tx_hash = tx.sha256
tx_value = tx.vout[0].nValue
# Verify that unnecessary witnesses are rejected. # Verify that unnecessary witnesses are rejected.
self.test_node.announce_tx_and_wait_for_getdata(tx) self.test_node.announce_tx_and_wait_for_getdata(tx)

3
qa/rpc-tests/receivedby.py

@ -14,7 +14,6 @@ def get_sub_array_from_array(object_array, to_match):
Finds and returns a sub array from an array of arrays. Finds and returns a sub array from an array of arrays.
to_match should be a unique idetifier of a sub array to_match should be a unique idetifier of a sub array
''' '''
num_matched = 0
for item in object_array: for item in object_array:
all_match = True all_match = True
for key,value in to_match.items(): for key,value in to_match.items():
@ -104,7 +103,7 @@ class ReceivedByTest(BitcoinTestFramework):
received_by_account_json = get_sub_array_from_array(self.nodes[1].listreceivedbyaccount(),{"account":account}) received_by_account_json = get_sub_array_from_array(self.nodes[1].listreceivedbyaccount(),{"account":account})
if len(received_by_account_json) == 0: if len(received_by_account_json) == 0:
raise AssertionError("No accounts found in node") raise AssertionError("No accounts found in node")
balance_by_account = rec_by_accountArr = self.nodes[1].getreceivedbyaccount(account) balance_by_account = self.nodes[1].getreceivedbyaccount(account)
txid = self.nodes[0].sendtoaddress(addr, 0.1) txid = self.nodes[0].sendtoaddress(addr, 0.1)
self.sync_all() self.sync_all()

1
qa/rpc-tests/replace-by-fee.py

@ -393,7 +393,6 @@ class ReplaceByFeeTest(BitcoinTestFramework):
utxo = make_utxo(self.nodes[0], initial_nValue) utxo = make_utxo(self.nodes[0], initial_nValue)
fee = int(0.0001*COIN) fee = int(0.0001*COIN)
split_value = int((initial_nValue-fee)/(MAX_REPLACEMENT_LIMIT+1)) split_value = int((initial_nValue-fee)/(MAX_REPLACEMENT_LIMIT+1))
actual_fee = initial_nValue - split_value*(MAX_REPLACEMENT_LIMIT+1)
outputs = [] outputs = []
for i in range(MAX_REPLACEMENT_LIMIT+1): for i in range(MAX_REPLACEMENT_LIMIT+1):

1
qa/rpc-tests/wallet.py

@ -359,7 +359,6 @@ class WalletTest (BitcoinTestFramework):
rawtx = self.nodes[0].createrawtransaction([{"txid":singletxid, "vout":0}], {chain_addrs[0]:node0_balance/2-Decimal('0.01'), chain_addrs[1]:node0_balance/2-Decimal('0.01')}) rawtx = self.nodes[0].createrawtransaction([{"txid":singletxid, "vout":0}], {chain_addrs[0]:node0_balance/2-Decimal('0.01'), chain_addrs[1]:node0_balance/2-Decimal('0.01')})
signedtx = self.nodes[0].signrawtransaction(rawtx) signedtx = self.nodes[0].signrawtransaction(rawtx)
singletxid = self.nodes[0].sendrawtransaction(signedtx["hex"]) singletxid = self.nodes[0].sendrawtransaction(signedtx["hex"])
txids = [singletxid, singletxid]
self.nodes[0].generate(1) self.nodes[0].generate(1)
# Make a long chain of unconfirmed payments without hitting mempool limit # Make a long chain of unconfirmed payments without hitting mempool limit

3
src/addrman.cpp

@ -54,11 +54,8 @@ double CAddrInfo::GetChance(int64_t nNow) const
{ {
double fChance = 1.0; double fChance = 1.0;
int64_t nSinceLastSeen = nNow - nTime;
int64_t nSinceLastTry = nNow - nLastTry; int64_t nSinceLastTry = nNow - nLastTry;
if (nSinceLastSeen < 0)
nSinceLastSeen = 0;
if (nSinceLastTry < 0) if (nSinceLastTry < 0)
nSinceLastTry = 0; nSinceLastTry = 0;

Loading…
Cancel
Save