don't forget namespace lifetime multiplier

This commit is contained in:
Jude Nelson
2017-09-28 23:12:12 -04:00
parent a3d55485f9
commit b61ab54747

View File

@@ -989,8 +989,9 @@ class BlockstackDB( virtualchain.StateEngine ):
# preorder must be younger than the namespace lifetime
# (otherwise we get into weird conditions where someone can preorder
# a name before someone else, and register it after it expires)
if preorder['block_number'] + namespace['lifetime'] <= self.lastblock:
log.debug("Preorder is too old (accepted at {}, namespace lifetime is {}, current block is {})".format(preorder['block_number'], namespace['lifetime'], self.lastblock))
namespace_lifetime_multiplier = get_epoch_namespace_lifetime_multiplier( self.lastblock, namespace_id )
if preorder['block_number'] + (namespace['lifetime'] * namespace_lifetime_multiplier) <= self.lastblock:
log.debug("Preorder is too old (accepted at {}, namespace lifetime is {}, current block is {})".format(preorder['block_number'], namespace['lifetime'] * namespace_lifetime_multiplier, self.lastblock))
return None
return preorder