0f6941150cdf98da92c40f85526735ec10e9daf1 spend: a nicer interface for providing fee informations (Antoine Poinsot)
990b153107dfae779b054d7ae52bcad574982f5f commands: don't query unconfirmed coins when creating recovery tx (Antoine Poinsot)
c63a120794af593704cede911f666467d3ce4c1e spend: don't use database's Coin type (Antoine Poinsot)
08ce0ad1d7ac7b4d519ca98a44ecaeb45c7d063c spend: update comment about create_spend behaviour (Antoine Poinsot)
0c395bb63c5e7c7f4ad53ae25743efa0f6afb4c7 spend: document the create_spend function (Antoine Poinsot)
f3113ba0d20ebed69a21ea50ed3adfe7f7c82a7d commands: remove redundant output value check (Antoine Poinsot)
5894e788b87f7335fb7715036e55add4202a83a8 spend: move tx size calc helper back to command module (Antoine Poinsot)
6ddda6137cd1a19e446a9a81623290de8ff0d5b8 spend: make coin selection helpers private (Antoine Poinsot)
33be1ff18bf3eeda772efaf29439340b30b5c5e9 commands: make create_recovery use the create_spend helper (Antoine Poinsot)
0523f0047fd463945cdb2147c2dc13c8538bb0d3 commands: update next deriv index for any spend output address (Antoine Poinsot)
5d5015553239fb19de0890a6956c8e22ebfec0f4 spend: avoid direct access to our Bitcoin backend (Antoine Poinsot)
7c238124bebf38fc93994b183de90c2baf0cb0c3 spend: don't access the database in the PSBT creation function (Antoine Poinsot)
22f97e11b7ab772d30ca9ccd992c9092559ab493 spend: let caller update next derivation index (Antoine Poinsot)
9fdb75cf883c53af97fbbe40a4d7f727611aebac commands: split up spend transaction creation into its own module (Antoine Poinsot)
Pull request description:
Based on top of #816, this introduces a new `spend` module with a helper to create a transaction spending coins from the wallet. It can be leveraged to create regular or recovery transactions, and also replacement for them. All the data structures used by the exposed spend creation function are contained with this module, in order to make it usable without a `lianad`-specific database and Bitcoin interface.
This PR is structured in an incremental fashion. First we pull out the `create_spend_internal` method introduced in #816 into a standalone `spend` module, then we incrementally remove the cruft and the ties from the spend module to the other components.
ACKs for top commit:
darosior:
self-ACK 0f6941150cdf98da92c40f85526735ec10e9daf1
Tree-SHA512: a75afeb2c1f58e685c6b6e0d88c53e158ad850266261ef93b20065f6b02ad9e817cefcef4a89dc038e4db81549efc6d5393e4c59b4f7d86b69dc2168b9d818d3
Allows for a clearer interface: you explicitly set whether you are
creating a replacement, and you don't have dangling 0s when you don't
which necessitate a comment to explain what they correspond to.
71fd9c4900bb1bf6f263867eb85b6e81da6c4b1e gui: enable use of RBF on pending transactions (jp1ac4)
ce50dd8c41522a2f45c5bc79505762857c8f8bcd gui: optionally filter spend transactions by txids (jp1ac4)
4846a0b05a9ea32d1fd3bb7852b3b74cee99daeb gui: update liana dependency (jp1ac4)
Pull request description:
This is to resolve#43.
When viewing an unconfirmed transaction, a user can now either bump its fee or cancel it. This will generate a new PSBT that the user can jump to in order to sign and broadcast it.
I haven't added any comparison between the previous and replacement inputs as suggested in https://github.com/wizardsardine/liana/issues/43#issuecomment-1825623520. I think that would be a bigger change and might be better as a follow-up.
I decided not to add "Unconfirmed" on the transaction screen as suggested in https://github.com/wizardsardine/liana/issues/43#issuecomment-1831763013 as I thought it might be better as a separate PR.
I haven't yet added the RBF buttons to the home screen, but that could also be done as a follow-up :)
In a separate commit, I pass `None` to `create_spend` following #821.
ACKs for top commit:
darosior:
tested-but-not-review ACK 71fd9c4900bb1bf6f263867eb85b6e81da6c4b1e
edouardparis:
ACK 71fd9c4900bb1bf6f263867eb85b6e81da6c4b1e
Tree-SHA512: c3ddbb85ad008e9e450b79ba77816ad9065f1eec675913f20463c4271ff017d5cb9ff0a0fca9ed919c97b3f6bb2b806344dc4ff062f5393ad5ac85c8c039ab83
7d993ac021d8f4e7dcb2f8500272dd2550cf6d03 gui: bump managed bitcoind version to 26.0 (jp1ac4)
Pull request description:
This is to close#851.
ACKs for top commit:
darosior:
ACK 7d993ac021d8f4e7dcb2f8500272dd2550cf6d03
Tree-SHA512: 1e0c727557d4b3566f505689d1937b7a148240f937e4edc1b9ed12e983b3a1dc56f11e39fc8342b32c1d0580c970462b2bc62d4bdfea8748d63347da9cab0901
This is a first step toward removing the database accesses from the
spend PSBT creation helper. It now always take a change address, and
return whether it used it. If it did the caller retrieves the
information about the change address and if necessary bumps the next
derivation index to use.
36700c47596c396fe9b6cde432bd6c33961aceed Cargo: use the published bdk_coin_select (Antoine Poinsot)
Pull request description:
Draft until https://github.com/bitcoindevkit/coin-select/pull/9 is published on crates.io.
ACKs for top commit:
jp1ac4:
ACK 36700c4759.
Tree-SHA512: 52caf8e79641e6f2bb0a58a75480866d5e99d9a6d9e220cd92b3de1c7f612166ee220c49f49c766271dac67c317c7b50a09763c4451988e2cfff517234833af7
0ab00cd6580ddc1964f4f328a90ab9c5f3f87efa gui: keep conflicting PSBTs as Pending until confirmation (jp1ac4)
5391bfe04ccbe2103460cd195fe4ea3309507118 commands: add `rbfpsbt` command (jp1ac4)
d5f31674045155b6a9be7e08e4beab4c2187b573 commands: add `create_spend_internal` function (jp1ac4)
714fd5e142ffdf95d5ca96cd5a1d6edbc68239bb bitcoin: add `mempool_spenders` to Bitcoin interface (jp1ac4)
68b2503b12cececb1e3259d2d88a34e5191ec232 func tests: move function to utils (jp1ac4)
fdab722effa79c6063e5b40748409ac4048aa1b6 func tests: run black (jp1ac4)
Pull request description:
This PR relates to #43 and #236.
It adds a `rbfpsbt` command that generates a PSBT to replace an existing transaction using RBF. This replacement can either preserve non-change outputs and simply bump fees or remove non-change outputs and effectively cancel the transaction. The inputs and change output may need to be updated in accordance with the higher fee.
I've also added a `getmempoolentry` call to the bitcoin interface that is used for checking information about descendant transactions.
To facilitate development, I've made some temporary changes in the GUI so that replacement PSBTs can be signed and broadcast, but these changes might not be part of this PR in the end.
ACKs for top commit:
darosior:
ACK 0ab00cd6580ddc1964f4f328a90ab9c5f3f87efa
Tree-SHA512: a172ad895fac13be294451f2ffeccb91af521d58a3bc6d08e09688996f9a3e07a3e230091982ef5e92472d44db77b34f93b81d1111d2c570d9c5dd85b7c21f0f
This is a more general version of `create_spend` in that it allows
for a mixure of both mandatory and optional coin selection candidates
and has a `min_fee` parameter.
Another difference is that it takes destination addresses that have
been checked for the network and amounts as `Amount`.
`create_spend` has been updated to call `create_spend_internal`.
3077062c84f598350248e6725e5781b9bc209ce9 gui: installer: clearer placeholder in xpub edit field (Antoine Poinsot)
Pull request description:
I'm not sure what rustfmt is doing here.
Fixes#451.
ACKs for top commit:
pythcoiner:
utACK 3077062c84
edouardparis:
utACK 3077062c84f598350248e6725e5781b9bc209ce9
Tree-SHA512: 79637d3c147c19ff5b7a4758da62089e51990d611e992591b2368f2e3135c06c547804d75c0bf3e5394843e29d582edb71487039a23fdae507cc6c6eae28ec36
As coins deposited by an unconfirmed
transactions can be removed from
the database, GUI should not rely
on them to calculate fees.
The fees must be passed as Option.
If a input coin is missing for a psbt,
we use the witness_utxo amount
and settle the total fee to None
if both are absents.
6bd6218d64495e6b5ac844861434ee8b1564ea02 qa: demonstrate sweep functionality using createpsbt's change_address (Antoine Poinsot)
a77a36cb9eac49d7a936cf24bd02122c085b894e commands: make it possible to create a sweep spend transaction (Antoine Poinsot)
Pull request description:
We add a way to specify what change address to use. This allows the caller to set an external address which has for effect to sweep all the inputs' value to this address, after deduction of the fees and the other (optionally) set destination addresses.
For instance, combined with a self-send (no other destination) and by setting all the wallet's unspent coins, this allows one to sweep all the funds of the wallet to an external address.
ACKs for top commit:
jp1ac4:
ACK 6bd6218d64.
Tree-SHA512: d157bf5782a743297ec243c071b3cf2215f2836710f583a3a1a363bbc4a0504db73297e9be4b583b36377094976cacb4f46d18cee96153e00eec5e94c96ac710
We leverage the change logic for this. By making it possible to set the
change address to an external address, one can send all the value from
the inputs to this address.
6123b87a024c04906338aa68c6afbcf57d57fc0b commands: fix documentation (jp1ac4)
b8fd97fc83a18acb8f1f6b20216fd048955e909d commands: require change for self-send (jp1ac4)
Pull request description:
This adds a new `LowestFeeChangeCondition` metric for use in coin selection. It's the same as `LowestFee` with the option to only find solutions with change.
This option is then used for self-sends to ensure only a solution with change will be returned.
ACKs for top commit:
darosior:
ACK 6123b87a024c04906338aa68c6afbcf57d57fc0b
Tree-SHA512: af12ddce712be31bfdf6bd7eea2fcc651cdbafef32e5b59f7b30dbbc6cf55a13ca5658075942b76947d87c384681f1dbae2d579c8d58298202bf85b9b066a1e0
This adds a new `LowestFeeChangeCondition` metric for use in
coin selection. It's the same as `LowestFee` with the option
to only find solutions with change.
This option is then used for self-sends to ensure only a solution
with change will be returned.
758a4d6578aba487ae6ea06d32ece247525aba8b bitcoin: poller: fix spend expiration from mempool, again (Antoine Poinsot)
Pull request description:
Always mark a spend dropped from mempool as expired if it, or a conflict spending this coin, wasn't mined. The previous logic was confused: it would only do so if a conflict was detected, but it's not the only reason for a tx to be dropped from the mempool.
ACKs for top commit:
jp1ac4:
ACK 758a4d6578.
Tree-SHA512: 84cab482c139dd7170e1139f2718550036195bb6262090af89c1e5eb51c0f3abfd344158b8bf20884a638d77ce342801c66182209e1776b3db9b2700f32deab3
Always mark a spend dropped from mempool as expired if it, or a conflict spending this coin, wasn't mined. The previous logic was confused: it would only do so if a conflict was detected, but it's not the only reason for a tx to be dropped from the mempool.