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

Handle JsonRpcError in _estimate_fee_basic #1658

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

kristapsk
Copy link
Member

_estimate_fee_basic is supposed to return None if fee rate can't be estimated and then estimate_fee_per_kb handles that with hardcoded fallback fee. But JsonRpcError wasn't handled and it could fail when fee estimation is not working in Core.

Fixes #1653.

Previously it outputed unhandled error and hanged, now it's:

2024-02-10 02:05:11,803 [DEBUG]  rpc: estimatesmartfee [3]
2024-02-10 02:05:11,812 [WARNING]  Could not source a fee estimate from Core
2024-02-10 02:05:11,813 [WARNING]  Fee estimation for 3 block confirmation target failed. Falling back to default (randomized for privacy): 11976 sat/kvB (11.9 sat/vB).
2024-02-10 02:05:11,815 [DEBUG]  rpc: getmempoolinfo []
2024-02-10 02:05:11,818 [DEBUG]  rpc: estimatesmartfee [3]
2024-02-10 02:05:11,820 [WARNING]  Could not source a fee estimate from Core
2024-02-10 02:05:11,821 [WARNING]  Fee estimation for 3 block confirmation target failed. Falling back to default (randomized for privacy): 10279 sat/kvB (10.2 sat/vB).
2024-02-10 02:05:11,849 [INFO]  Using a fee of: 0.00001449 BTC (1449 sat).

rpc_result = self._rpc('estimatesmartfee', [conf_target + i])
try:
rpc_result = self._rpc('estimatesmartfee', [conf_target + i])
except JsonRpcError:
Copy link
Member Author

Choose a reason for hiding this comment

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

Probably could log.debug error details here too, before continue.

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.

JoinMarket doesn't handle "Fee estimation disabled" error from Bitcoin Core
1 participant