Skip to content

Further improve unconfirmed tx conflict resolution #1102

Closed
@evanlinjin

Description

@evanlinjin

Describe the enhancement

At the end of ticket #1063's description, there is a Further work section which states:

Our current structures do not handle unconfirmed conflicts properly when the conflicting transactions have the same last_seen timestamp (thanks to @rajarshimaitra for pointing this out).

// FIXME: Currently both the mempool tx are indexed and listed out. This can happen in case of RBF fee bumps,
// when both the txs are observed at a single sync time. This can be resolved by checking the input's nSequence.
// Additionally in case of non RBF conflicts at same `seen_at`, conflicting txids can be reported back for filtering
// out in higher layers. This is similar to what core rpc does in case of unresolvable conflicts.

I propose we deal with this as follows:

When two unconfirmed txs conflict, but have the same last_seen, we can check the input's sequences (using RBF rules). Otherwise, we sort by feerate (if possible). We fallback to lexicographical sorting of txids.

Metadata

Metadata

Assignees

No one assigned

    Labels

    new featureNew feature or request

    Type

    No type

    Projects

    Status

    Done

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions