New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
server/asset/doge: use feeConfs and reduce maxFeeBlocks #1965
Conversation
server/asset/doge/doge.go
Outdated
@@ -92,7 +92,8 @@ func NewBackend(configPath string, logger dex.Logger, network dex.Network) (asse | |||
Net: network, | |||
ChainParams: params, | |||
Ports: ports, | |||
DumbFeeEstimates: true, | |||
DumbFeeEstimates: true, // dogecoind actually has estimatesmartfee though... |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@@ -49,7 +49,7 @@ const ( | |||
version = 0 | |||
BipID = 3 | |||
assetName = "doge" | |||
feeConfs = 10 | |||
feeConfs = 8 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The table I pasted there is still accurate even today, except for the high number at 3.
@@ -14,7 +14,7 @@ import ( | |||
"github.com/btcsuite/btcd/chaincfg" | |||
) | |||
|
|||
var maxFeeBlocks = 50 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In practice, it hung and context times out with a remote node. This just needs to make an quick effort and fall back to the "no competition" rate it can't get 101 txns in 16 blocks or less.
654a3db
to
6f5fc53
Compare
6f5fc53
to
2e8d9b1
Compare
This resolves a couple minor bugs introduced in #1597
The
feeConfs
arg that was previously used forestimatefee
was neglected when theFeeEstimator
config item was replaced with a more sophisticated(*Backend).estimateFee
method. This setting was important for DOGE and BCH where a value of 1 almost always returns an estimate of -1 (failure), resulting in one of the median fee estimates. In the case it was the "hard" way that is extremely demanding in terms of RPCs to the node, making a remote dogecoind instance virtually infeasible.A second change is reducing the max blocks in the hard median fee estimator from 50 to 16, which is plenty because if it doesn't find 101 txns in 16 blocks it should just go with the "no competition" rate.