nblockchain / geewallet

geewallet is a non-custodial, minimalistic & pragmatist opensource crossplatform lightweight brainwallet to hold the most important cryptoassets in the same application with ease & peace of mind
MIT License
61 stars 37 forks source link

Only 1 available server (when consistency settings requires 2) generates misleading exception #250

Closed knocte closed 9 months ago

knocte commented 9 months ago

Steps to reproduce:

  1. Query balance of currency X, with the bad luck that none of the servers are reachable except 1 (and the settings of this currency require 2 minimum).

Current results:

GWallet.Backend.ResultInconsistencyException: Results obtained were not enough to be considered consistent (received: 1, consistent: 1, required: 2)
   at <StartupCode$GWallet-Backend>.$FaultTolerantParallelClient.clo@571-48.Invoke(FinalResult`3 _arg3) in /Users/knocte/Documents/Code/geewalletSTABLE/src/GWallet.Backend/FaultTolerantParallelClient.fs:line 612
   at Microsoft.FSharp.Control.AsyncPrimitives.CallThenInvokeNoHijackCheck[a,b](AsyncActivation`1 ctxt, b result1, FSharpFunc`2 userCode) in D:\a\_work\1\s\src\FSharp.Core\async.fs:line 528
   at <StartupCode$GWallet-Backend>.$FaultTolerantParallelClient.jobWithCancellation@508-3.Invoke(AsyncActivation`1 ctxt)
   at <StartupCode$GWallet-Backend>.$FaultTolerantParallelClient.clo@304-23.Invoke(AsyncActivation`1 ctxt)
   at <StartupCode$GWallet-Backend>.$FaultTolerantParallelClient.WhenAny@120-2.Invoke(AsyncActivation`1 ctxt)
   at Microsoft.FSharp.Control.Trampoline.Execute(FSharpFunc`2 firstAction) in D:\a\_work\1\s\src\FSharp.Core\async.fs:line 112
--- End of stack trace from previous location ---
   at Microsoft.FSharp.Control.AsyncResult`1.Commit() in D:\a\_work\1\s\src\FSharp.Core\async.fs:line 454
   at Microsoft.FSharp.Control.AsyncPrimitives.QueueAsyncAndWaitForResultSynchronously[a](CancellationToken token, FSharpAsync`1 computation, FSharpOption`1 timeout) in D:\a\_work\1\s\src\FSharp.Core\async.fs:line 1140
   at Microsoft.FSharp.Control.AsyncPrimitives.RunSynchronously[T](CancellationToken cancellationToken, FSharpAsync`1 computation, FSharpOption`1 timeout) in D:\a\_work\1\s\src\FSharp.Core\async.fs:line 1167
   at Microsoft.FSharp.Control.FSharpAsync.RunSynchronously[T](FSharpAsync`1 computation, FSharpOption`1 timeout, FSharpOption`1 cancellationToken) in D:\a\_work\1\s\src\FSharp.Core\async.fs:line 1511
   at Program.ProgramMainLoop[a]() in /Users/knocte/Documents/Code/geewalletSTABLE/src/GWallet.Frontend.Console/Program.fs:line 473
   at Program.NormalStartWithNoParameters() in /Users/knocte/Documents/Code/geewalletSTABLE/src/GWallet.Frontend.Console/Program.fs:line 490

Expected results: This exception should not be raised, and FTPC should keep trying with different servers to find 1 more consistent result.