Browse Source

Floor disk_count at zero.

master
Neil Booth 8 years ago
parent
commit
8617c82ec2
  1. 2
      server/block_processor.py
  2. 1
      server/db.py

2
server/block_processor.py

@ -828,7 +828,7 @@ class BlockProcessor(server.db.DB):
def read_headers(self, start, count):
# Read some from disk
disk_count = min(count, self.fs_height + 1 - start)
disk_count = min(count, max(0, self.fs_height + 1 - start))
result = self.fs_read_headers(start, disk_count)
count -= disk_count
start += disk_count

1
server/db.py

@ -143,6 +143,7 @@ class DB(LoggedClass):
raise
def fs_read_headers(self, start, count):
'''Requires count >= 0.'''
# Read some from disk
disk_count = min(count, self.db_height + 1 - start)
if start < 0 or count < 0 or disk_count != count:

Loading…
Cancel
Save