Skip to content

Commit

Permalink
Fix a bug where a socket connection to "bsv.aftrek.org" is successful…
Browse files Browse the repository at this point in the history
…ly established but on protocol negotiation, the result is "None"

- This crashes the entire asyncio event loop with "TypeError: cannot unpack non-iterable NoneType object"
- Catch the raised TypeError to avoid crashing the asyncio event loop.
  • Loading branch information
AustEcon committed Aug 14, 2023
1 parent f275274 commit 032ffac
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -61,5 +61,5 @@ Pipfile
Pipfile.lock

# local data directories
electrum_sv_data/regtest/*
electrum_sv_data/*
instance_*
2 changes: 1 addition & 1 deletion electrumsv/network.py
Original file line number Diff line number Diff line change
Expand Up @@ -465,7 +465,7 @@ async def _negotiate_protocol(self):
self.logger.debug(f'negotiated protocol: {protocol_string}')
self.ptuple = protocol_tuple(protocol_string)
assert PROTOCOL_MIN <= self.ptuple <= PROTOCOL_MAX
except (AssertionError, ValueError) as e:
except (AssertionError, TypeError, ValueError) as e:
raise DisconnectSessionError(f'{method} failed: {e}', blacklist=True)

async def _get_checkpoint_headers(self):
Expand Down

0 comments on commit 032ffac

Please sign in to comment.