1
0

interface: PaddedRSTransport: keep in sync with e-x: flush on close

ref f62f986b33

note: ReplyAndDisconnect is specific to electrumx, however I think the name is descriptive enough to keep it here.
This commit is contained in:
SomberNight
2025-10-27 18:09:33 +00:00
parent 356f50beae
commit 6423323037

View File

@@ -428,6 +428,13 @@ class PaddedRSTransport(RSTransport):
# No polling here, we always force-empty the buffer.
self._force_send = True
async def close(self, *args, **kwargs):
'''Close the connection and return when closed.'''
# Flush buffer before disconnecting. This makes ReplyAndDisconnect work:
self._force_send = True
self._maybe_consume_sbuffer()
await super().close(*args, **kwargs)
class ServerAddr: