Wallet: Remove random component of locktime
On locktime, @markblundeberg wrote on bitcoincashresearch:
- Locktime of 0 is easy for a wallet to choose.
- Locktime = current block height was introduced to address the potential problem of ‘fee sniping’.
- Locktime = current block height - random(0,99) is used 10% of the time on Bitcoin Core-derived wallets.
- Locktime = current block height + 1 is apparently being used (at least on BTC) by some entity that is not setting sequence properly either, leading to an obvious fingerprint.
This MR changes our behaviour from variant 3 to variant 2, achieving parity with Electron Cash.
Unlike variant 3, variant 2 also aligns with the rationale of BIP69 (see #229), which argues that unnecessary randomness in transaction construction must be avoided.
Additionally, I find the original rationale of variant 3 (see diff) unconvincing - these high-latency transactions are likely to stand out anyways for other reasons.
Finally, variant 2 is much more convenient than variant 3 if you are trying to split your coins in a chain split scenario.
This MR has no effect on 90% of created transactions.
Test plan: make check && qa/pull-tester/rpc-tests.py