-
Notifications
You must be signed in to change notification settings - Fork 296
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
dcrjson: add estimatesmartfee #1201
Conversation
dcrjson/chainsvrcmds.go
Outdated
// estimatefee JSON-RPC command. | ||
func NewEstimateFeeCmd(numBlocks int64) *EstimateFeeCmd { | ||
return &EstimateFeeCmd{ | ||
NumBlocks: numBlocks, | ||
} | ||
} | ||
|
||
// EstimateSmartFeeMode defines estimation mode to be used with | ||
// the estimatesmartfee command. | ||
type EstimateSmartFeeMode int |
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.
I think this should be a string as numbers change over time and adding new string modes is much less likely to break older clients.
dcrjson/chainsvrresults.go
Outdated
type EstimateSmartFeeResult struct { | ||
FeeRate float64 `json:"feerate"` | ||
Error []string `json:"error"` | ||
blocks int64 `json:"blocks"` |
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.
Blocks
should be exported.
dcrjson/chainsvrcmds.go
Outdated
const ( | ||
// EstimateSmartFeeEconomical returns an | ||
// economical result. | ||
EstimateSmartFeeEconomical EstimateSmartFeeMode = iota |
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.
As mentioned this would be better as a string, so with that change, this comment will become moot, but values used in RPC APIs generally shouldn't use iota
because they need to be stable, unlike internal APIs where it doesn't really matter if the actual numbers change.
No description provided.