Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix bug where bwt sendsd 2017 headers to electrum #87

Merged
merged 1 commit into from
Mar 18, 2021

Conversation

stevenroose
Copy link
Contributor

It was causing this error in electrum 4.0.9:


E/i | interface.[localhost:50001] | Exception in wrapper_func: RequestCorrupted('expected 2016 headers but only got 2017')
Traceback (most recent call last):
  File "/usr/lib/python3.9/site-packages/electrum/util.py", line 1056, in wrapper
    return await func(*args, **kwargs)
  File "/usr/lib/python3.9/site-packages/electrum/interface.py", line 481, in wrapper_func
    return await func(self, *args, **kwargs)
  File "/usr/lib/python3.9/site-packages/electrum/interface.py", line 505, in run
    await self.open_session(ssl_context)
  File "/usr/lib/python3.9/site-packages/electrum/interface.py", line 649, in open_session
    await group.spawn(self.monitor_connection)
  File "/usr/lib/python3.9/site-packages/aiorpcx/curio.py", line 242, in __aexit__
    await self.join()
  File "/usr/lib/python3.9/site-packages/aiorpcx/curio.py", line 211, in join
    raise task.exception()
  File "/usr/lib/python3.9/site-packages/electrum/interface.py", line 703, in run_fetch_blocks
    await self._process_header_at_tip()
  File "/usr/lib/python3.9/site-packages/electrum/interface.py", line 720, in _process_header_at_tip
    await self.sync_until(height)
  File "/usr/lib/python3.9/site-packages/electrum/interface.py", line 729, in sync_until
    could_connect, num_headers = await self.request_chunk(height, next_height)
  File "/usr/lib/python3.9/site-packages/electrum/interface.py", line 613, in request_chunk
    raise RequestCorrupted(f"expected {size} headers but only got {res['count']}")
electrum.interface.RequestCorrupted: expected 2016 headers but only got 2017

@stevenroose
Copy link
Contributor Author

The assertion failed without the fix.

@shesek
Copy link
Collaborator

shesek commented Mar 18, 2021

Thanks!

I wonder how I never ran into this, probably only happens if the wallet is in some unusual state?

@shesek shesek merged commit 4844fe1 into bwt-dev:master Mar 18, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants