File tree Expand file tree Collapse file tree 1 file changed +45
-3
lines changed Expand file tree Collapse file tree 1 file changed +45
-3
lines changed Original file line number Diff line number Diff line change @@ -54,7 +54,10 @@ export default class Wallet {
54
54
55
55
/** Refresh network info every 3s until there are at least 3 peers. */
56
56
autorunAsync ( ( ) => {
57
- if ( this . peers . length < 3 ) {
57
+ if (
58
+ this . peers . length < 3 ||
59
+ this . info . getnetworkinfo . endpoints . length === 0
60
+ ) {
58
61
this . restart ( 'getNetworkInfo' )
59
62
}
60
63
} , 3 * 1000 )
@@ -266,6 +269,11 @@ export default class Wallet {
266
269
*/
267
270
@computed get info ( ) {
268
271
return this . responses . entries ( ) . reduce ( ( responses , [ key , value ] ) => {
272
+ /** RPC getnetworkinfo returns null if endpoints array is empty. */
273
+ if ( key === 'getnetworkinfo' && value . endpoints === null ) {
274
+ value . endpoints = [ ]
275
+ }
276
+
269
277
responses [ key ] = value
270
278
return responses
271
279
} , {
@@ -281,14 +289,48 @@ export default class Wallet {
281
289
'proof-of-work' : 0 ,
282
290
'proof-of-stake' : 0
283
291
} ,
292
+ 'getmininginfo' : {
293
+ blocks : 0 ,
294
+ currentblocksize : 0 ,
295
+ currentblocktx : 0 ,
296
+ difficulty : 0 ,
297
+ errors : '' ,
298
+ generate : null ,
299
+ genproclimit : 0 ,
300
+ hashespersec : 0 ,
301
+ networkhashps : 0 ,
302
+ pooledtx : 0 ,
303
+ testnet : null
304
+ } ,
284
305
'getincentiveinfo' : {
285
- collateralbalance : 0
306
+ walletaddress : '' ,
307
+ collateralrequired : 0 ,
308
+ collateralbalance : 0 ,
309
+ networkstatus : '' ,
310
+ votecandidate : false ,
311
+ votescore : 0
286
312
} ,
287
313
'getinfo' : {
314
+ version : ':' ,
315
+ protocolversion : 0 ,
316
+ walletversion : 0 ,
288
317
balance : 0 ,
289
- version : ':'
318
+ newmint : 0 ,
319
+ stake : 0 ,
320
+ blocks : 0 ,
321
+ moneysupply : 0 ,
322
+ connections : 0 ,
323
+ ip : '' ,
324
+ port : 0 ,
325
+ difficulty : 0 ,
326
+ testnet : false ,
327
+ keypoolsize : 0 ,
328
+ paytxfee : 0 ,
329
+ relayfee : 0
290
330
} ,
291
331
'getnetworkinfo' : {
332
+ collateralized : 0 ,
333
+ endpoints : [ ] ,
292
334
tcp : { connections : 0 } ,
293
335
udp : { connections : 0 }
294
336
}
You can’t perform that action at this time.
0 commit comments