From: Alekos Filini Date: Wed, 29 Jun 2022 13:57:57 +0000 (+0200) Subject: Merge bitcoindevkit/bdk#611: Discourage fee sniping with nLockTime X-Git-Tag: 0.20.0~15 X-Git-Url: http://internal-gitweb-vhost/script/%22https:/database/enum.FileError.html?a=commitdiff_plain;h=bb55923a7de881668c8080bcb994b20615a328a0;p=bdk Merge bitcoindevkit/bdk#611: Discourage fee sniping with nLockTime 97bc9dc7170c336e97cd756b1f07ac3c23a39626 Discourage fee sniping with nLockTime (Daniela Brozzoni) Pull request description: ### Description By default bdk sets the transaction's nLockTime to current_height to prevent fee sniping. current_height can be provided by the user through TxParams; if the user didn't provide it, we use the last sync height, or 0 if we never synced. Fixes https://github.com/bitcoindevkit/bdk/issues/533 ### Notes to the reviewers: If you want to know more about fee sniping: https://bitcoinops.org/en/topics/fee-sniping/ ### Checklists #### All Submissions: * [x] I've signed all my commits * [x] I followed the [contribution guidelines](https://github.com/bitcoindevkit/bdk/blob/master/CONTRIBUTING.md) * [x] I ran `cargo fmt` and `cargo clippy` before committing #### New Features: * [x] I've added tests for the new feature * [x] I've added docs for the new feature * [x] I've updated `CHANGELOG.md` ACKs for top commit: afilini: ACK 97bc9dc7170c336e97cd756b1f07ac3c23a39626 Tree-SHA512: e92d1ae907687d9fee44d120d790f1ebdf14b698194979e1be8433310fd5636afa63808effed12fce6091f968ec6b76b727cfee6fed54068af0a7450239fdd26 --- bb55923a7de881668c8080bcb994b20615a328a0