Skip to content

wallet: don't back-date locktime when replacing/fee bumping #26526

@0xB10C

Description

@0xB10C

As mentioned in #26451 (comment) example 3:

If we do anti-fee sniping, the Bitcoin Core wallet has a 10% chance to back-date the locktime of a transaction to up to 100 blocks. Electrum has similar behavior.

// Secondly occasionally randomly pick a nLockTime even further back, so
// that transactions that are delayed after signing for whatever reason,
// e.g. high-latency mix networks and some CoinJoin implementations, have
// better privacy.
if (rng_fast.randrange(10) == 0) {
tx.nLockTime = std::max(0, int(tx.nLockTime) - int(rng_fast.randrange(100)));
}

When we fee-bump a transaction, it can happen that we have a higher locktime in replaced transaction that in the replacement transaction. This is a clear indication that we are in fact a Bitcoin Core or Electrum wallet doing the replacement. I think this is something we should try to avoid.

related: #26527
electrum issue: spesmilo/electrum#8073

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions