Skip to content

Commit

Permalink
Fix issue with 1 byte data items
Browse files Browse the repository at this point in the history
  • Loading branch information
Cryp Toon committed Apr 12, 2024
1 parent b267e67 commit a595854
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 2 deletions.
2 changes: 1 addition & 1 deletion bitcoinlib/scripts.py
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,7 @@ def get_data_type(data):
elif ((data.startswith(b'\x02') or data.startswith(b'\x03')) and len(data) == 33) or \
(data.startswith(b'\x04') and len(data) == 65):
return 'key'
elif len(data) == 20 or len(data) == 32 or len(data) == 64 or 1 < len(data) <= 4:
elif len(data) == 20 or len(data) == 32 or len(data) == 64 or 1 <= len(data) <= 4:
return 'data-%d' % len(data)
else:
return 'other'
Expand Down
2 changes: 1 addition & 1 deletion bitcoinlib/services/bitcoind.py
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,7 @@ def __init__(self, network='bitcoin', base_url='', denominator=100000000, *args)
bdc = self.from_config('', network)
base_url = bdc.base_url
network = bdc.network
wallet_name = '' if not len(args) >= 6 else args[6]
wallet_name = '' if not len(args) > 6 else args[6]
if wallet_name:
base_url = base_url.replace("{wallet_name}", wallet_name)
_logger.info("Connect to bitcoind")
Expand Down
2 changes: 2 additions & 0 deletions examples/wallet_bitcoind_connected_wallets2.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,3 +25,5 @@
w.scan(scan_gap_limit=1)
w.info()

# TODO
# FIXME

0 comments on commit a595854

Please sign in to comment.