pass -1 for offset/length if not known or we don't care (don't use None)

This commit is contained in:
Jude Nelson
2016-09-16 17:46:14 -04:00
parent 6df34adb46
commit c57bfab3bd

View File

@@ -776,6 +776,12 @@ class BlockstackDB( virtualchain.StateEngine ):
Returns the list of names.
"""
if offset is not None and offset < 0:
offset = None
if count is not None and count < 0:
count = None
cur = self.db.cursor()
names = namedb_get_all_names( cur, self.lastblock, offset=offset, count=count )
return names
@@ -787,6 +793,12 @@ class BlockstackDB( virtualchain.StateEngine ):
Returns the list of names.
"""
if offset is not None and offset < 0:
offset = None
if count is not None and count < 0:
count = None
cur = self.db.cursor()
names = namedb_get_names_in_namespace( cur, namespace_id, self.lastblock, offset=offset, count=count )
return names