Skip to content

The TxGraph spends field does not need to be a BTreeMap, could be a HashMap instead. #2026

@oleonardolima

Description

@oleonardolima

Describe the enhancement

I was discussing with @evanlinjin about the CanonicalIter, and we noticed a possible optimization on the TxGraph spends field.

It's currently a BTreeMap, but it could be updated to become a HashMap instead. However, it would require reworking the TxDescendants::populate_queue() method.

Use case

All fields in TxGraph are only either a HashMap, HashSet or BTreeSet.

Impact

  • Blocking production usage
  • Nice-to-have / UX improvement
  • Developer experience / maintainability

Are you using BDK in a production project?

  • Yes
  • No
  • Not yet, but planning to

Which backend(s) are relevant (if any)?

  • Electrum
  • Esplora
  • Bitcoin Core RPC
  • None / not backend-related (e.g. bdk_chain, bdk_core)
  • Other (please specify): ____

Project or organization (optional)

Additional context

Metadata

Metadata

Assignees

No one assigned

    Labels

    discussionThere's still a discussion ongoing

    Type

    No type

    Projects

    Status

    Discussion

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions