fix too short headers file
This commit is contained in:
@@ -949,8 +949,8 @@ class Network(util.DaemonThread):
|
|||||||
def init_headers_file(self):
|
def init_headers_file(self):
|
||||||
b = self.blockchains[0]
|
b = self.blockchains[0]
|
||||||
filename = b.path()
|
filename = b.path()
|
||||||
if not os.path.exists(filename):
|
length = 80 * len(bitcoin.NetworkConstants.CHECKPOINTS) * 2016
|
||||||
length = 80 * len(bitcoin.NetworkConstants.CHECKPOINTS) * 2016
|
if not os.path.exists(filename) or os.path.getsize(filename) < length:
|
||||||
with open(filename, 'wb') as f:
|
with open(filename, 'wb') as f:
|
||||||
if length>0:
|
if length>0:
|
||||||
f.seek(length-1)
|
f.seek(length-1)
|
||||||
|
|||||||
Reference in New Issue
Block a user