Skip to content

Commit

Permalink
Namecoin: Apply difficulty retargeting hardfork that activated with A…
Browse files Browse the repository at this point in the history
…uxPoW.
  • Loading branch information
JeremyRand committed Jun 30, 2018
1 parent b98723f commit f67a253
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion lib/blockchain.py
Original file line number Diff line number Diff line change
Expand Up @@ -303,7 +303,11 @@ def get_target(self, index):
h, t = self.checkpoints[index]
return t
# new target
first = self.read_header(index * 2016)
if (index * 2016 + 2015 > 19200) and (index * 2016 + 2015 + 1 > 2016):
# Namecoin: Apply retargeting hardfork after AuxPoW start
first = self.read_header(index * 2016 - 1)
else:
first = self.read_header(index * 2016)
last = self.read_header(index * 2016 + 2015)
if not first or not last:
raise MissingHeader()
Expand Down

0 comments on commit f67a253

Please sign in to comment.