Skip to content

Consider dropping unwrap_or(1.0) from convert_fee_rate #80

@tnull

Description

@tnull

Currently, when something goes wrong/the corresponding pair can't be found, convert_fee_rate will default to a bogus 1.0 fee rate:

pairs
.into_iter()
.find(|(k, _)| k <= &target)
.map(|(_, v)| v)
.unwrap_or(1.0)

This however messes with users' assumptions they depend on receiving a correct fee update (e.g. in Lightning). Rather than returning a (btw. undocumented) default value, convert_fee_rate should just error out if something goes wrong, as it's fallible anyways.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions