mirror of
https://github.com/alexgo-io/stacks-puppet-node.git
synced 2026-04-22 10:36:57 +08:00
optionally avoid calling a UTXO client method (in case it might lead to recursion)
This commit is contained in:
@@ -413,7 +413,7 @@ def connect_utxo_provider( utxo_opts, min_confirmations=TX_MIN_CONFIRMATIONS ):
|
||||
raise Exception("Unrecognized UTXO provider '%s'" % utxo_provider )
|
||||
|
||||
|
||||
def get_unspents(address, blockchain_client):
|
||||
def get_unspents(address, blockchain_client, use_builtin=True):
|
||||
"""
|
||||
Gets the unspent outputs for a given address.
|
||||
Returns [{
|
||||
@@ -444,7 +444,7 @@ def get_unspents(address, blockchain_client):
|
||||
return blockstack_utxo_get_unspents(address, blockchain_client)
|
||||
|
||||
# default
|
||||
elif hasattr(blockchain_client, "get_unspents"):
|
||||
elif use_builtin and hasattr(blockchain_client, "get_unspents"):
|
||||
return blockchain_client.get_unspents( address )
|
||||
else:
|
||||
raise Exception('A blockchain client object is required')
|
||||
|
||||
Reference in New Issue
Block a user