Skip to content

Commit

Permalink
Allow only subscribing to scripthashes @ contrib/history.py
Browse files Browse the repository at this point in the history
  • Loading branch information
romanz committed Feb 4, 2022
1 parent 953beea commit e101739
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions contrib/history.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ def main():
parser.add_argument('--host', default='localhost')
parser.add_argument('--network', default='mainnet')
parser.add_argument('address', nargs='+')
parser.add_argument('--only-subscribe', action='store_true', default=False)
args = parser.parse_args()

if args.network == 'regtest':
Expand Down Expand Up @@ -62,6 +63,8 @@ def main():
for script_hash in script_hashes
)
log.info('subscribed to {} scripthashes', len(script_hashes))
if args.only_subscribe:
return

balances = conn.call(
client.request('blockchain.scripthash.get_balance', script_hash)
Expand Down

0 comments on commit e101739

Please sign in to comment.