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

[0.6] server/btc: use external fee rates #2638

Open
wants to merge 1 commit into
base: release-v0.6
Choose a base branch
from

Conversation

buck54321
Copy link
Member

The estimatesmartfee RPC is not very responsive to changing conditions and often gives fee rates that are too high. Try to use fee rates from mempool.space or btc.com before falling back estimatesmartfee. Retrieve rates every five minutes, preferring mempool.space. Fall back if rates are stale by 10 minutes.

Some profiling of fee rate sources was done separately. Ask on Element for results if interested.

Comment on lines +431 to +438
case <-tick.C:
feeRate := btc.fetchExternalBitcoinFeeRate(ctx)
if feeRate > 0 {
btc.feeRateCache.Lock()
btc.feeRateCache.stamp = time.Now()
btc.feeRateCache.feeRate = feeRate
btc.feeRateCache.Unlock()
}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe try again sooner on a failure? In case of a one-off connection issue.

wg.Add(1)
go func() {
defer wg.Done()
tick := time.NewTicker(time.Minute * 5)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe defer tick.Stop()

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.

None yet

3 participants