Skip to content

Wallet should take cluster limits into account when creating a transaction #2066

@ImplOfAnImpl

Description

@ImplOfAnImpl

Since #2063, the mempool has limits for how many txs are allowed to form a cluster and how big in bytes that cluster can be. Currently the wallet doesn't take these limits into account, so it's possible for it to create a tx that will be rejected by the mempool.

At the very least, the wallet should:

  • Prefer confirmed utxos during utxo selection, to avoid forming clusters.
  • After the tx is constructed, it should ask the mempool for the tx count and byte size of the cluster that will be formed if this tx is added (for which the corresponding methods should be exposed in node RPC) and then, ideally, try some other utxo combination.

Also note that even though currently the mempool only tracks utxo-based relations (#2065), the wallet should be prepared that at some point this won't be the case anymore and take into account non-utxo relations too.

There are some other possible improvements in utxo selection, see the TODO near Account::select_inputs_for_send_request.

P.S. if a general utxo selection revamp is attempted, then this - #1923 - should probably be fixed as well.

Metadata

Metadata

Assignees

No one assigned

    Labels

    walletEverything related to the node wallets (whether GUI or CLI)

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions