Skip to content

Commit 2d51a4d

Browse files
committed
Backend/Ether: rm etcIsMomentarilyCentralized flag
ETC was previously marked as non-centeralized[1], this commit removes this flag since it's no longer needed. [1] 9392215
1 parent 2ec087f commit 2d51a4d

File tree

1 file changed

+6
-26
lines changed

1 file changed

+6
-26
lines changed

src/GWallet.Backend/Ether/EtherServer.fs

Lines changed: 6 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -322,8 +322,6 @@ module Server =
322322
| ServerSelectionMode.Fast -> 3u
323323
| ServerSelectionMode.Analysis -> 2u
324324

325-
let etcEcosystemIsMomentarilyCentralized = false
326-
327325
let private FaultTolerantParallelClientInnerSettings (numberOfConsistentResponsesRequired: uint32)
328326
(mode: ServerSelectionMode)
329327
currency
@@ -334,10 +332,7 @@ module Server =
334332
| None -> SpecificNumberOfConsistentResponsesRequired numberOfConsistentResponsesRequired
335333
| Some specificConsistencyConfig -> specificConsistencyConfig
336334

337-
let retries =
338-
match currency with
339-
| Currency.ETC when etcEcosystemIsMomentarilyCentralized -> Config.NUMBER_OF_RETRIES_TO_SAME_SERVERS * 2u
340-
| _ -> Config.NUMBER_OF_RETRIES_TO_SAME_SERVERS
335+
let retries = Config.NUMBER_OF_RETRIES_TO_SAME_SERVERS
341336

342337
{
343338
NumberOfParallelJobsAllowed = NumberOfParallelJobsForMode mode
@@ -359,11 +354,7 @@ module Server =
359354
}
360355

361356
let private FaultTolerantParallelClientDefaultSettings (mode: ServerSelectionMode) (currency: Currency) =
362-
let numberOfConsistentResponsesRequired =
363-
if etcEcosystemIsMomentarilyCentralized && currency = Currency.ETC then
364-
1u
365-
else
366-
2u
357+
let numberOfConsistentResponsesRequired = 2u
367358
FaultTolerantParallelClientInnerSettings numberOfConsistentResponsesRequired
368359
mode
369360
currency
@@ -372,9 +363,7 @@ module Server =
372363
(currency: Currency)
373364
(cacheOrInitialBalanceMatchFunc: decimal->bool) =
374365
let consistencyConfig =
375-
if etcEcosystemIsMomentarilyCentralized && currency = Currency.ETC then
376-
None
377-
elif mode = ServerSelectionMode.Fast then
366+
if mode = ServerSelectionMode.Fast then
378367
Some (OneServerConsistentWithCertainValueOrTwoServers cacheOrInitialBalanceMatchFunc)
379368
else
380369
None
@@ -389,7 +378,7 @@ module Server =
389378

390379
let Web3ServerToRetrievalFunc (server: ServerDetails)
391380
(web3ClientFunc: SomeWeb3->Async<'R>)
392-
currency
381+
_currency
393382
: Async<'R> =
394383

395384
let HandlePossibleEtherFailures (job: Async<'R>): Async<'R> =
@@ -404,12 +393,7 @@ module Server =
404393
return raise <| FSharpUtil.ReRaise ex
405394
}
406395

407-
let connectionTimeout =
408-
match currency with
409-
| Currency.ETC when etcEcosystemIsMomentarilyCentralized ->
410-
Config.DEFAULT_NETWORK_TIMEOUT + Config.DEFAULT_NETWORK_TIMEOUT
411-
| _ ->
412-
Config.DEFAULT_NETWORK_TIMEOUT
396+
let connectionTimeout = Config.DEFAULT_NETWORK_TIMEOUT
413397

414398
async {
415399
let web3Server = Web3Server (connectionTimeout, server)
@@ -660,11 +644,7 @@ module Server =
660644
return hexBigInteger
661645
}
662646
GetRandomizedFuncs currency web3Func
663-
let minResponsesRequired =
664-
if etcEcosystemIsMomentarilyCentralized && currency = Currency.ETC then
665-
1u
666-
else
667-
2u
647+
let minResponsesRequired = 2u
668648
return! faultTolerantEtherClient.Query
669649
(FaultTolerantParallelClientDefaultSettings
670650
ServerSelectionMode.Fast

0 commit comments

Comments
 (0)