Skip to content
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/btc: recognize errNoFeeRate #1655

Merged
merged 1 commit into from
Jun 16, 2022

Conversation

chappjc
Copy link
Member

@chappjc chappjc commented Jun 8, 2022

The server logs spam like this every epoch (with two DOGE markets):

2022-06-08 04:35:30.000 [TRC] ASSET[doge]: Estimatefee error for doge: fee could not be estimated                                                                                                    
2022-06-08 04:35:30.001 [DBG] ASSET[doge]: Fee estimate unavailable for doge. Using median fee.                                                                                                      
2022-06-08 04:35:30.001 [TRC] ASSET[doge]: Using cached doge median fee rate                                                                                                                         2022-06-08 04:35:30.001 [TRC] ASSET[doge]: Estimatefee error for doge: fee could not be estimated                                                                                                    
2022-06-08 04:35:30.001 [DBG] ASSET[doge]: Fee estimate unavailable for doge. Using median fee.                                                                                                      
2022-06-08 04:35:30.001 [TRC] ASSET[doge]: Using cached doge median fee rate 

This PR cools off the logs a bit by introducing errNoFeeRate to go along with errNoCompetition. The errNoFeeRate is just used by the estimate fee methods when there's no error from the RPC, but the rate is zero. This leads to median fee estimation based on past blocks (or a cached rate) and is generally not an error condition.

This also removes btc.name from many of the log statements in btc.Backend because the logger's prefix already contains the asset, e.g. [DBG] ASSET[doge]: Blocks are too empty to calculate median fees. Using no-competition rate (4000).

@chappjc chappjc added this to the 0.5 milestone Jun 9, 2022
@chappjc chappjc merged commit a8baabf into decred:master Jun 16, 2022
@chappjc chappjc deleted the calm-server-fee-logs branch June 16, 2022 14:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants