@@ -157,22 +157,23 @@ async def handle_request(self, request):
157157 'blockchain.transaction.get' : self ._handle_transaction_get ,
158158 'blockchain.transaction.broadcast' : self ._handle_transaction_broadcast ,
159159 'blockchain.transaction.get_merkle' : self ._handle_transaction_get_merkle ,
160+ 'mempool.get_info' : self ._handle_mempool_get_info ,
160161 'server.ping' : self ._handle_ping ,
161162 }
162163 handler = handlers .get (request .method )
163164 self ._method_counts [request .method ] += 1
164165 coro = aiorpcx .handler_invocation (handler , request )()
165166 return await coro
166167
167- async def _handle_server_version (self , client_name = '' , protocol_version = None ):
168- return ['best_server_impl /0.1' , '1.4 ' ]
168+ async def _handle_server_version (self , client_name = '' , protocol_version = None , * args , ** kwargs ):
169+ return ['toy_server /0.1' , '1.6 ' ]
169170
170171 async def _handle_server_features (self ) -> dict :
171172 return {
172173 'genesis_hash' : constants .net .GENESIS ,
173174 'hosts' : {"14.3.140.101" : {"tcp_port" : 51001 , "ssl_port" : 51002 }},
174- 'protocol_max' : '1.7.0 ' ,
175- 'protocol_min' : '1.4.3 ' ,
175+ 'protocol_max' : '1.6 ' ,
176+ 'protocol_min' : '1.6 ' ,
176177 'pruning' : None ,
177178 'server_version' : 'ElectrumX 1.19.0' ,
178179 'hash_function' : 'sha256' ,
@@ -181,6 +182,13 @@ async def _handle_server_features(self) -> dict:
181182 async def _handle_estimatefee (self , number , mode = None ):
182183 return 0.00001000
183184
185+ async def _handle_mempool_get_info (self ):
186+ return {
187+ "mempoolminfee" : 0.00001000 ,
188+ "minrelaytxfee" : 0.00001000 ,
189+ "incrementalrelayfee" : 0.00001000 ,
190+ }
191+
184192 def _get_headersub_result (self ):
185193 return {'hex' : BLOCK_HEADERS [self .cur_height ].hex (), 'height' : self .cur_height }
186194
@@ -195,8 +203,8 @@ async def _handle_block_headers(self, start_height, count):
195203 assert start_height <= self .cur_height , (start_height , self .cur_height )
196204 last_height = min (start_height + count - 1 , self .cur_height ) # [start_height, last_height]
197205 count = last_height - start_height + 1
198- headers = b"" . join (BLOCK_HEADERS [idx ] for idx in range (start_height , last_height + 1 ))
199- return {'hex ' : headers . hex () , 'count' : count , 'max' : 2016 }
206+ headers = list (BLOCK_HEADERS [idx ]. hex () for idx in range (start_height , last_height + 1 ))
207+ return {'headers ' : headers , 'count' : count , 'max' : 2016 }
200208
201209 async def _handle_ping (self ):
202210 return None
0 commit comments