added storagecounter test and renamed setup
This commit is contained in:
parent
311dda91d6
commit
085b90f84c
20 changed files with 120 additions and 76 deletions
|
@ -46,7 +46,7 @@ def download_blocks_from_communicator(comm_inst):
|
|||
if not shoulddownload.should_download(comm_inst, blockHash):
|
||||
continue
|
||||
|
||||
if comm_inst.shutdown or not comm_inst.isOnline or storage_counter.isFull():
|
||||
if comm_inst.shutdown or not comm_inst.isOnline or storage_counter.is_full():
|
||||
# Exit loop if shutting down or offline, or disk allocation reached
|
||||
break
|
||||
# Do not download blocks being downloaded
|
||||
|
|
|
@ -43,7 +43,7 @@ def clean_old_blocks(comm_inst):
|
|||
__remove_from_upload(comm_inst, bHash)
|
||||
logger.info('Deleted block: %s' % (bHash,))
|
||||
|
||||
while comm_inst.storage_counter.isFull():
|
||||
while comm_inst.storage_counter.is_full():
|
||||
oldest = blockmetadb.get_block_list()[0]
|
||||
blacklist.addToDB(oldest)
|
||||
removeblock.remove_block(oldest)
|
||||
|
|
|
@ -40,7 +40,7 @@ def lookup_blocks_from_communicator(comm_inst):
|
|||
if not comm_inst.isOnline:
|
||||
break
|
||||
# check if disk allocation is used
|
||||
if comm_inst.storage_counter.isFull():
|
||||
if comm_inst.storage_counter.is_full():
|
||||
logger.debug('Not looking up new blocks due to maximum amount of allowed disk space used')
|
||||
break
|
||||
peer = onlinepeers.pick_online_peer(comm_inst) # select random online peer
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue