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

dcrjson: add estimatesmartfee #1201

Merged
merged 1 commit into from
May 14, 2018
Merged

dcrjson: add estimatesmartfee #1201

merged 1 commit into from
May 14, 2018

Conversation

dajohi
Copy link
Member

@dajohi dajohi commented May 11, 2018

No description provided.

// 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
Copy link
Member

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.

type EstimateSmartFeeResult struct {
FeeRate float64 `json:"feerate"`
Error []string `json:"error"`
blocks int64 `json:"blocks"`
Copy link
Member

Choose a reason for hiding this comment

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

Blocks should be exported.

const (
// EstimateSmartFeeEconomical returns an
// economical result.
EstimateSmartFeeEconomical EstimateSmartFeeMode = iota
Copy link
Member

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.

@davecgh davecgh added this to the 1.3.0 milestone May 12, 2018
@davecgh davecgh merged commit 6adfdf6 into decred:master May 14, 2018
@dajohi dajohi deleted the estimatesmartfee1 branch February 28, 2019 00:56
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