From ba41094ed22bbe0195ada6f3c3ec5012058895ff Mon Sep 17 00:00:00 2001 From: Josh Babb Date: Thu, 25 May 2023 13:56:18 -0500 Subject: [PATCH] send next available request in queue if isNotEmpty --- lib/electrumx_rpc/rpc2.dart | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/lib/electrumx_rpc/rpc2.dart b/lib/electrumx_rpc/rpc2.dart index 73f63e656..64306fc27 100644 --- a/lib/electrumx_rpc/rpc2.dart +++ b/lib/electrumx_rpc/rpc2.dart @@ -56,6 +56,14 @@ class JsonRPC { level: LogLevel.Info, ); _socket?.destroy(); + + if (_requestQueue.isNotEmpty) { + Logging.instance.log( + "JsonRPC doneHandler: sending next request in queue", + level: LogLevel.Warning, + ); + _sendNextAvailableRequest(); + } } Future _onReqCompleted(_JsonRPCRequest req) async {