mirror of
https://github.com/alexgo-io/stacks-puppet-node.git
synced 2026-04-24 03:45:38 +08:00
pass -1 for offset/length if not known or we don't care (don't use None)
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user