Merge pull request #767 from cypherstack/dogecoin

Dogecoin fee estimation hackfix
This commit is contained in:
Diego Salazar 2024-02-22 10:58:33 -07:00 committed by GitHub
commit 345ad9e0a2
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -1019,22 +1019,11 @@ class ElectrumXClient {
(response == null || (response == null ||
response == -1 || response == -1 ||
Decimal.parse(response.toString()) == Decimal.parse("-1"))) { Decimal.parse(response.toString()) == Decimal.parse("-1"))) {
return Decimal.parse("0.00001024"); // Return 0.05 for slow, 0.2 for average, and 1 for fast txs.
// blockchain.estimatefee response for 1-, 5-, and 10--block intervals // These numbers produce tx fees in line with txs in the wild on
// as of 2024/02/20 ("1.024e-05"). // https://dogechain.info/
// TODO [prio=med]: Fix fee estimation. Refer to the following: return Decimal.parse((1 / blocks).toString());
// $ openssl s_client -connect dogecoin.stackwallet.com:50002 // TODO [prio=med]: Fix fee estimation.
// ...
// $ {"id": 1, "method": "blockchain.estimatefee", "params": [1]}
// {"jsonrpc": "2.0", "result": 1.024e-05, "id": 1}
// $ {"id": 1, "method": "blockchain.estimatefee", "params": [5]}
// {"jsonrpc": "2.0", "result": 1.024e-05, "id": 1}
// $ {"id": 1, "method": "blockchain.estimatefee", "params": [10]}
// {"jsonrpc": "2.0", "result": 1.024e-05, "id": 1}
// $ {"id": 1, "method": "blockchain.estimatefee", "params": [50]}
// {"jsonrpc": "2.0", "result": -1, "id": 1}
// $ {"id": 1, "method": "blockchain.estimatefee", "params": [100]}
// {"jsonrpc": "2.0", "result": -1, "id": 1}w
} }
return Decimal.parse(response.toString()); return Decimal.parse(response.toString());
} catch (e, s) { } catch (e, s) {