optionally get name history rows in reverse

This commit is contained in:
Jude Nelson
2018-06-20 11:44:15 -04:00
parent 7ac2a0e74b
commit b73d508c06

View File

@@ -830,12 +830,12 @@ class BlockstackDB( virtualchain.StateEngine ):
return namedb_get_namespace_at(cur, namespace_id, block_number, include_expired=True)
def get_name_history( self, name ):
def get_name_history( self, name, offset=None, count=None, reverse=False):
"""
Get the historic states for a name
Get the historic states for a name, grouped by block height.
"""
cur = self.db.cursor()
name_hist = namedb_get_history( cur, name )
name_hist = namedb_get_history( cur, name, offset=offset, count=count, reverse=reverse )
return name_hist