mirror of
https://github.com/alexgo-io/stacks-puppet-node.git
synced 2026-04-25 20:35:33 +08:00
add include_expired to get_namespace_op_state; fix get_namespace_at to
work at all block heights
This commit is contained in:
@@ -584,7 +584,7 @@ class BlockstackDB( virtualchain.StateEngine ):
|
||||
"""
|
||||
|
||||
cur = self.db.cursor()
|
||||
return namedb_get_namespace( cur, namespace_id, block_number )
|
||||
return namedb_get_namespace( cur, namespace_id, block_number, include_expired=include_expired )
|
||||
|
||||
|
||||
@autofill( "opcode" )
|
||||
@@ -653,13 +653,11 @@ class BlockstackDB( virtualchain.StateEngine ):
|
||||
at a particular block number.
|
||||
"""
|
||||
|
||||
namespace_rec = self.get_namespace( namespace_id )
|
||||
cur = self.db.cursor()
|
||||
namespace_rec = namedb_get_namespace( cur, namespace_id, None, include_expired=True )
|
||||
if namespace_rec is None:
|
||||
return None
|
||||
|
||||
if block_number < namespace_rec['block_number']:
|
||||
return None
|
||||
|
||||
historical_recs = namedb_restore_from_history( namespace_rec, block_number )
|
||||
return historical_recs
|
||||
|
||||
|
||||
Reference in New Issue
Block a user