1245 Commits

Author SHA1 Message Date
Antoine Poinsot
bc25addf34
bitcoin: don't assign incorrect spend_txid on conflict tx confirmation 2023-11-17 13:52:58 +01:00
Antoine Poinsot
20ab30924f
qa: add a test describing current poller behaviour wrt replacements 2023-11-17 13:52:57 +01:00
Antoine Poinsot
514535d8d6
Merge #818: Add derivation_index to GetAddressResult
33384c89b5cdaec9d4a477644609ff0d1508cf9f Add derivation_index to GetAddressResult (edouardparis)

Pull request description:

  My bad, i pushed my fixes in a rush in #815 and wrecked the PR.

ACKs for top commit:
  darosior:
    ACK 33384c89b5cdaec9d4a477644609ff0d1508cf9f

Tree-SHA512: 5f18506a84ff10fbe13757c2522b11a7ec005243f8698425f1d761d4b36378c256150d3d8337fefc1938232990004bbd629878b42b032b1dd0349d593a39386d
2023-11-16 18:13:46 +01:00
edouardparis
33384c89b5
Add derivation_index to GetAddressResult
The derivation index is required for
for client to derive and verify the address
on hardware wallets.

Co-Authored-By: Antoine Poinsot <darosior@protonmail.com>
2023-11-16 18:12:34 +01:00
Antoine Poinsot
bd71cd646c
Merge #815: Add derivation_index to GetAddressResult
2e2afc1d7bf85dec7319b78e5a2634558952bc25 doc: document deriv index in getnewaddress result (Antoine Poinsot)

Pull request description:

  The derivation index is required for
  for client to derive and verify the address
  on hardware wallets.

ACKs for top commit:
  darosior:
    ACK 2e2afc1d7bf85dec7319b78e5a2634558952bc25

Tree-SHA512: dd6280662244ff307a8eceb76a48d7b0ed651cc6e512708029afd6dda4bde0b0d0f8a63d30b9a7710d819f03e2d4bad250e3e24abab23578b5b684665a429c52
2023-11-16 18:10:54 +01:00
Antoine Poinsot
2e2afc1d7b
doc: document deriv index in getnewaddress result 2023-11-16 18:09:51 +01:00
Antoine Poinsot
2d303b139d
Merge #560: Apply coin selection for spend
cfa0f91dd36bc81d5820baf975930e94063ef691 commands: auto-select coins if none provided (jp1ac4)

Pull request description:

  These are some initial changes towards #51.

  I've added a `selectcoinsforspend` command that applies BnB coin selection using a waste metric.

  This coin selection is then used in `createspend` if no coins are specified.

  @darosior The changes are still in their early stages so I'm creating this draft PR to facilitate discussion about the approach in general and specific details.

ACKs for top commit:
  darosior:
    ACK cfa0f91dd36bc81d5820baf975930e94063ef691

Tree-SHA512: 2b94a8f4d335366e477fff54fa51d478ef459e2e729bac00a5d4ac21d04667409cb685642f27fd1936456a05a8d76d23483e45a24f5d342f9a26de904bb6639c
2023-11-15 18:22:40 +01:00
Antoine Poinsot
e0fba88930
Merge #813: db: check for change using address strings only
79c5f92d9c690c36308a9d3fa4b35a4c4f6e01d4 db: check for change using address strings only (jp1ac4)

Pull request description:

  Comparing the address itself includes the network, but an unchecked signet address will have its network set as testnet by `assume_checked` and so change addresses will not be matched.

ACKs for top commit:
  darosior:
    utACK 79c5f92d9c690c36308a9d3fa4b35a4c4f6e01d4

Tree-SHA512: 50c87a6feac3f659584e92ad8781092bf513d63a590453f87d8617ec4b309ec3128050e6c10114d0150e08a373d4d1824a99b2530ab82eb5b14dd3790ec15237
2023-11-15 12:37:23 +01:00
jp1ac4
79c5f92d9c
db: check for change using address strings only
Comparing the address itself includes the network, but an
unchecked signet address will have its network set as testnet
by `assume_checked` and so change addresses will not be
matched.
2023-11-15 11:27:17 +00:00
jp1ac4
cfa0f91dd3
commands: auto-select coins if none provided
When creating a new spend, if coin outpoints are not provided,
then coins will be selected automatically.

This automatic selection is such that the transaction fee is
minimized, taking into account the cost of creating any
change output now and the cost of spending it in the future.

If change is added, it must reduce the transaction waste and
be above the dust threshold. This same policy is applied also
in the case of manual coin selection, replacing the previous
logic for determining the change amount. This ensures that
creating a spend with auto-selection and another with manual
selection using the same auto-selected coins will give the
same change amount.
2023-11-14 13:32:53 +00:00
Antoine Poinsot
44f5a85b43
Merge #808: Followup to #709
0812a1216690514a0cf5ee6d80dbc6366fd91d43 jsonrpc: don't ignore invalid params to listaddresses (Antoine Poinsot)
d5338201d292ccf8d87849966c2f93efdfa0ccda commands: listaddresses cleanups (Antoine Poinsot)

Pull request description:

  This addresses my latest review from #709.

ACKs for top commit:
  jp1ac4:
    ACK 0812a12166

Tree-SHA512: 6f708fd2f1aa2f229a5c78a35e363870ef390513cce10fc6a5938b49e6b7ee5be9205bc4566376750e4f7eeea404709ce6d8c7a29df15b9216b8dbcf4b4fed7e
2023-11-13 11:55:51 +01:00
Antoine Poinsot
479efe7494
Merge #709: Implement listadresses
2660b77487d63218019413a4ca33b3a9629fbfc8 implement listadresses (pythcoiner)

Pull request description:

  address #681

  todo:
  - [x]  implement tests
  - [x] update docs

  edit: i'm really new to rust, don't hesitate to kick my ass when i write stupid code

ACKs for top commit:
  darosior:
    ACK 2660b77487d63218019413a4ca33b3a9629fbfc8 -- my requests are addressed in followup #808.

Tree-SHA512: a5fdfb4516dc0379bfec1be535e752795dec75d28cbc5b9fa4fe9898fa00b1cfaa9cee3b95f4dfd68365f4585426e1b4457a8366cc4f783600704994f879526f
2023-11-11 14:43:23 +01:00
Antoine Poinsot
0812a12166
jsonrpc: don't ignore invalid params to listaddresses 2023-11-11 14:25:24 +01:00
Antoine Poinsot
d5338201d2
commands: listaddresses cleanups
Introduce a single error enum variant. Avoid underflows. Clarify and comment the logic.
2023-11-11 13:59:06 +01:00
pythcoiner
2660b77487 implement listadresses 2023-11-10 14:59:44 +01:00
Antoine Poinsot
8548c62618
Merge #807: gui: display headers sync progress too in loader
88d00ae1a3c99b32a5bd0aa457b16bb1a8ad064f gui: display headers sync progress too in loader (Antoine Poinsot)

Pull request description:

  Maybe we should just get rid of the filtering since there is no stability guarantees wrt logging. On the other hand we'd probably need to increase the update frequency if we do that. In the meantime at least display also the blockheaders so the sync doesn't appear to be stuck for 5 minutes at startup.

  Fixes #780.

ACKs for top commit:
  jp1ac4:
    ACK 88d00ae1a3.

Tree-SHA512: 7ec75c7eea18bba23691fe20e2e4a4680c724e50b77d834da5384c1f1fcbc1e1100d6bb8aacd4ec01e7dbd5051a489376c97168d214054465d7ae3a7ae1fc120
2023-11-10 13:24:53 +01:00
Antoine Poinsot
88d00ae1a3
gui: display headers sync progress too in loader
Maybe we should just get rid of the filtering since there is no stability guarantees wrt logging. On the other hand we'd probably need to increase the update frequency if we do that. In the meantime at least display also the blockheaders so the sync doesn't appear to be stuck for 5 minutes at startup.
2023-11-10 12:52:39 +01:00
Antoine Poinsot
d5b7a3a7de
Merge #786: docs: fix typos
4fe9397a5e8977718a32cbf7752987d344e51654 fix typos (omahs)

Pull request description:

  docs: fix typos

ACKs for top commit:
  darosior:
    ACK 4fe9397a5e8977718a32cbf7752987d344e51654

Tree-SHA512: ab0d7d1ae41e22d7a9993ed1efc4aad311e47c8d30662446623c02a5a50018ddc78b8df991f43b7a875bee368629bff4cf2413375c589e57d9ab5fa9e4f6bed0
2023-11-02 15:16:58 +01:00
omahs
4fe9397a5e fix typos 2023-11-02 15:02:43 +01:00
Antoine Poinsot
65d3159dcc
Merge #764: Release notes and README updates for 3.0
083db4dc3468804863d952af12d09b0eb09a75bd CHANGELOG: add an entry about #770 (Antoine Poinsot)
2199bd3c116f70e5ea40703b1744fd7282d8141e CHANGELOG: 3.0 release notes (Antoine Poinsot)
b1e4e3ebab927956bd2f8a69dae85d9a0decdc21 README: update binaries' version to 3.0 (Antoine Poinsot)

Pull request description:

ACKs for top commit:
  darosior:
    ACK 083db4dc3468804863d952af12d09b0eb09a75bd -- just doc

Tree-SHA512: 511f95f5b637d40c56d3e51ed833f266b8f6c40cd357f23810311c47edb54918fe0a3afb32f942bf2bb0610502891b30d80cb1ce9e19b69516adc8f58e324fd0
2023-11-02 13:48:16 +01:00
Antoine Poinsot
083db4dc34
CHANGELOG: add an entry about #770 2023-11-02 13:47:09 +01:00
Antoine Poinsot
d32e0ff813
Merge #785: gui: view: fix the display of PSBT missing signatures
73f168bd0986b86fc5a3059f6004515deceb3b2d gui: view: fix the display of PSBT missing signatures (Antoine Poinsot)

Pull request description:

  The analysis was wrongly displayed. For instance it could display a fingerprint as having both signed and not signed yet.

  Clean up the code and fix the analysis.

ACKs for top commit:
  darosior:
    ACK 73f168bd0986b86fc5a3059f6004515deceb3b2d -- reapplying Edouard's ACK from #783

Tree-SHA512: 1e59702b58e843248c62b62a5ac277f1b0d58841b7d0a9a6ca045fbbbf956999d5982e975f8812fcd59bb4b5c2366bb3c01a69a9a373fecc6d2f719ec046ab62
2023-11-02 13:38:58 +01:00
Antoine Poinsot
73f168bd09
gui: view: fix the display of PSBT missing signatures
The analysis was wrongly displayed. For instance it could display a
fingerprint as having both signed and not signed yet.

Clean up the code and fix the analysis.
2023-11-02 13:10:20 +01:00
Antoine Poinsot
7c0c7351b9
Merge #777: installer: start new bitcoind download if not finished previously
bdd16c73bcae64e17931bd62d70f4d85b9a6af9a installer: start new bitcoind download if not finished (jp1ac4)

Pull request description:

  In case the user clicks on "Previous" before the bitcoind download has finished, this PR will clear the incomplete download (or a download that completed with errors) from `InternalBitcoindStep`.

  If the user then returns to this step, either a new download will start or the finished download will be available still. This fixes a bug following #746 for users that already have bitcoind v25.0 installed. If they click "Previous" while downloading 25.1, then upon returning to this step, the existing 25.0 bitcoind will be started.

ACKs for top commit:
  darosior:
    ACK bdd16c73bcae64e17931bd62d70f4d85b9a6af9a -- code makes sense to me and Kevin tested it fixed (one of) the bug he reported.

Tree-SHA512: d1f39b1ee2b1f6fa15533f6c7880dc0e3edc9e7052be8ff315d77232eab9e74f8178252979c14cd8ccac8f164176cbe03a18faf523c969d841d11d6721b18fe1
2023-11-02 13:06:25 +01:00
Antoine Poinsot
fd484a9523
Merge #778: doc: mention the bitbox too is supported now!
9d9c4e57c2de0ae6e61bdf3d402dbfc172ed5ae3 doc: mention the bitbox too is supported now! (Antoine Poinsot)

Pull request description:

ACKs for top commit:
  darosior:
    self-ACK 9d9c4e57c2de0ae6e61bdf3d402dbfc172ed5ae3 -- trivial

Tree-SHA512: 09b3c38ec64014c0e961b5396b3ea70ec8d62cf40f5c61936a6e00344c26f5db44da55a0d29564e96ba953261119836b405a172708993e338c11b022a05b3fd0
2023-11-02 10:56:35 +01:00
Antoine Poinsot
9d9c4e57c2
doc: mention the bitbox too is supported now! 2023-11-02 10:54:38 +01:00
jp1ac4
bdd16c73bc
installer: start new bitcoind download if not finished
In case user clicks on Previous before bitcoind download has
finished, this will clear the incomplete download from
`InternalBitcoindStep` so that a new download will start if the
user returns to this step.
2023-11-01 18:07:32 +00:00
Antoine Poinsot
cf9404558f
Merge #773: gui: don't read bitcoind's stdout to avoid a deadlock
d0065898f70fbe14be7d269a686110e3bbbe7af8 loader: don't read bitcoind's stdout to avoid a deadlock (edouardparis)

Pull request description:

  "Forward port" of #770.

  It was possible to get into a state where we were waiting for lianad to start, which was waiting on a response from bitcoind which in turn was waiting on the GUI to make room in its piped stdout buffer. Deadlock.

  Instead of getting its logs from stdout, read its debug.log file.

ACKs for top commit:
  edouardparis:
    ACK d0065898f70fbe14be7d269a686110e3bbbe7af8

Tree-SHA512: 0c66190ba87b56b883d15463ad24e152e43b33bf235ba8fb2cab6978c6eace1fdf3b6280377548a92248b18b0fa05bd4ad698cb65beac92bb5f11bc8a4662052
2023-11-01 16:28:35 +01:00
Antoine Poinsot
e0f491690b
Merge #772: installer: do not reload last step on next message
a14f3afa2aab52f686c2bc0a445ca359282922ae installer: do not reload last step on next message (edouardparis)

Pull request description:

  If a user clicked very fast a lot on the Next button to trigger multiple Next messages, then the last
  step of the install reloads multiple time.
  This commit introduce a check that ignore next message if the step is the last one.

ACKs for top commit:
  darosior:
    utACK a14f3afa2aab52f686c2bc0a445ca359282922ae -- code makes sense and the patch was tested by Kevin

Tree-SHA512: a0afb3eb0793e7d294bdf1d355816ea175f3652f0ce3b018150714ce22425a4ec1f8795173ac241cc43ad2d6dadb3668f0e0d7b720804cc83ad54cd99d9a27af
2023-11-01 16:13:13 +01:00
edouardparis
d0065898f7
loader: don't read bitcoind's stdout to avoid a deadlock
It was possible to get into a state where we were waiting for lianad to
start, which was waiting on a response from bitcoind which in turn was
waiting on the GUI to make room in its piped stdout buffer. Deadlock.

Instead of getting its logs from stdout, read its debug.log file.

Co-Authored-By: Antoine Poinsot <darosior@protonmail.com>
2023-11-01 15:53:53 +01:00
edouardparis
a14f3afa2a installer: do not reload last step on next message
If a user clicked very fast a lot on the Next button
to trigger multiple Next messages, then the last
step of the install reloads multiple time.
This commit introduce a check that ignore next message
if the step is the last one.
2023-11-01 15:29:54 +01:00
edouardparis
c861368802
Merge #769: fix single payment output label
d56a9a8a40671ad0ab0f4d8ccb8c6fa861d40429 fix single payment output label (edouardparis)

Pull request description:

  When a transaction has only one payment,
  then its txid label is attached to the payment label. While modifying the label of an output it did not change the whole transaction label, which is a bug.

  backport of the fix for 3.x in #768

ACKs for top commit:
  edouardparis:
    Self-ACK d56a9a8a40671ad0ab0f4d8ccb8c6fa861d40429

Tree-SHA512: 0c2bca6f2a5527c37653c3644907926f6dacd01f826a2538a78c898fda407e49dceb40614ef8389ae7663228da1c1121decf4be21dc8e0f9a44fd788b3c76972
2023-10-31 15:47:33 +01:00
edouardparis
f6b89ce699
Merge #765: fix gui: update labels if user signed an unsaved tx
789f952433d7ccc0f09924359bd87b83b0bdcf55 fix gui: update labels if user signed an unsaved tx (edouardparis)

Pull request description:

  It is a fix from #760

ACKs for top commit:
  edouardparis:
    Self-ACK 789f952433d7ccc0f09924359bd87b83b0bdcf55

Tree-SHA512: 3424577ba6d3215a3b7503a0861997ace0dbac0a82b0e43af5bc5fb5262450ab5074eaa54ce6a01021237b85dfb163d4eb436916d17f52b9dfd1a07cf7be269c
2023-10-31 15:46:46 +01:00
edouardparis
d56a9a8a40 fix single payment output label
When a transaction has only one payment,
then its txid label is attached to the payment label.
While modifying the label of an output it did not change the
whole transaction label, which is a bug.
2023-10-31 15:11:43 +01:00
edouardparis
7e039d7e38
Merge #766: fix wallet name in settings during install
9a4b665fa1a471a7a6c7e0dea09065f9f01ec35d fix wallet name in settings during install (edouardparis)

Pull request description:

  DEFAULT_WALLET_NAME aka simple Liana was still used during creation of wallet settings during install
  this should have been noticed if I did test the wallet creation process in detail and if I removed the public exposition of the const variable. SHAME

ACKs for top commit:
  edouardparis:
    Self-ACK 9a4b665fa1a471a7a6c7e0dea09065f9f01ec35d

Tree-SHA512: 3afd98918a7ddcd10e702d0aed66a0645bea734fde61febe021f07c67f5b42a28018e1556e052f03e413db9c75686f121091a7ab871c7c3533d62b7202761625
2023-10-31 10:18:07 +01:00
edouardparis
9a4b665fa1 fix wallet name in settings during install 2023-10-30 19:03:24 +01:00
edouardparis
789f952433 fix gui: update labels if user signed an unsaved tx 2023-10-30 18:57:54 +01:00
Antoine Poinsot
2199bd3c11
CHANGELOG: 3.0 release notes 2023-10-30 18:53:36 +01:00
Antoine Poinsot
b1e4e3ebab
README: update binaries' version to 3.0 2023-10-30 18:53:36 +01:00
Antoine Poinsot
49ce6e789b
Merge #762: Cargo: drop two keywords
5f0abbcc877fe0c31d11b21a2ce1ce7146dbbf38 Cargo: drop two keywords (Antoine Poinsot)

Pull request description:

  We had too many keywords to be able to publish on crates.io

ACKs for top commit:
  darosior:
    self-ACK 5f0abbcc877fe0c31d11b21a2ce1ce7146dbbf38 -- trivial

Tree-SHA512: daf57c3f036ff44c164fa80eb8a88afdb799a63d3a59e19423eacba579300bc76ec0a1168a9ae9260484b754b0695ae98da4b4ed7a0cf3eff885010d15fcec04
2023-10-30 18:42:39 +01:00
Antoine Poinsot
5f0abbcc87
Cargo: drop two keywords 2023-10-30 18:40:50 +01:00
edouardparis
976894e4c5
Merge #755: gui: add shell.nix to track dependencies
5bb96950b4d99a92e61e48a077b4236d9e3619c7 gui: add shell.nix to track dependencies (edouardparis)

Pull request description:

ACKs for top commit:
  edouardparis:
    Self-ACK 5bb96950b4d99a92e61e48a077b4236d9e3619c7

Tree-SHA512: b40b0f82631e45308f0690ea08ae2a0ab602dd7f9a108ba08ab6432797c92802c249d79ddf36247b560c51f336b715bf448185c864583e0e7cecbfdb7c6d7c3d
2023-10-30 15:35:41 +01:00
Antoine Poinsot
4de9772a93
Merge #751: GUI: prune BIP32 derivations for other spending paths when signing with BitBox02
99bbb76228de0762521cf9152fa35e267fca95b2 gui: prune bip32 derivations when signing with BitBox02 (Antoine Poinsot)
b8d6be82a7c9da80333d7470f6079d95e87210b8 gui: update to latest Liana (Antoine Poinsot)

Pull request description:

ACKs for top commit:
  edouardparis:
    ACK 99bbb76228de0762521cf9152fa35e267fca95b2

Tree-SHA512: 31476a0db1af0d3ce114c6709ec8e693bc9209475da532c541530ad6b96837a3eb4faf0e5061255c93c9adaab9b48503878966bf3a2aec4b7be34e729e2e1056
2023-10-30 15:05:29 +01:00
Antoine Poinsot
99bbb76228
gui: prune bip32 derivations when signing with BitBox02
It can otherwise lead to the BitBox02 not signing for the correct public
key. See
https://github.com/wizardsardine/liana/pull/706#issuecomment-1744705808
for details.
2023-10-30 14:01:37 +01:00
Antoine Poinsot
b8d6be82a7
gui: update to latest Liana 2023-10-30 14:01:36 +01:00
Antoine Poinsot
87555a8da5
Merge #750: descriptors: introduce a helper to prune BIP32 derivation paths
ea4c4462406f5a1860140ca92bb7fca34e1322e0 descriptor: add a helper which guesses which paths to prune from a PSBT (Antoine Poinsot)
d03e603abbd588d97da81cf0e51d28cbef82f94d descriptors: add a helper to prune BIP32 derivation paths (Antoine Poinsot)

Pull request description:

  Based on #749, this provides clients of the library with a way to prune all the BIP32 derivation paths in a PSBT for keys which are not part of the given spending path.

ACKs for top commit:
  edouardparis:
    utACK ea4c4462406f5a1860140ca92bb7fca34e1322e0

Tree-SHA512: f9f21e12e562a047693066e7b54c2601de01d79071ac40981406a04cf74bfc2da4111b5ea251e3a399a0df95ff6f873da7a7cbb112251100c81bfba171b0a21a
2023-10-30 13:58:52 +01:00
Antoine Poinsot
54969bba71
Merge #754: wallet: load name from settings
1cbbb8c0befe3c168fbbd34129a2f4f2a8c8726f wallet: load name from settings (edouardparis)

Pull request description:

  If an wallet settings already exists, the wallet name attached to the hardware wallet credentials must be use, instead of the new generated one.

  close #745

ACKs for top commit:
  darosior:
    ACK 1cbbb8c0befe3c168fbbd34129a2f4f2a8c8726f -- tested locally and discussed it with Edouard. I can't think of another place where we'd like to use the old wallet name.

Tree-SHA512: a06e64f4ada4fbadb6e132be740b480055113e733d658f4694cfcad15bb2901e6626af211ba5df95f4e08d9cb47080a96e97e29bf1c18e094dfbde6364408ce2
2023-10-30 13:48:25 +01:00
edouardparis
5bb96950b4 gui: add shell.nix to track dependencies 2023-10-30 13:42:34 +01:00
Antoine Poinsot
299b29bb6b
Merge #749: Revert PRs #722 and #742: roll back to including all BIP32 derivations in the PSBT input
17ca01322e7badd37fd4120e0aeec8d834d0d6df Revert "Merge #722: Only include BIP32 derivations for a single spending path when creating PSBTs" (Antoine Poinsot)
6f5b053ea5af4737885a25573c82d627c299236e Revert "Merge #742: commands: don't add derivation paths for keys from different path but same signer" (Antoine Poinsot)

Pull request description:

  #722 pruned the BIP32 derivation paths in PSBT inputs for other spending paths than the one this PSBT was created for. This was to make it possible to use them with the Bitbox (see #722 OP for more details).

  These were merged without testing at all whether it would break signing with a Ledger Nano. Turns out it did. Our bad. Thanks to Pythcoiner for finding this bug.

  A follow-up PR will add a helper to prune the derivation separately so that it can only be applied to some signers and not all of them.

ACKs for top commit:
  edouardparis:
    utACK 17ca01322e7badd37fd4120e0aeec8d834d0d6df

Tree-SHA512: 99764fc5c68bc66e8415d72bb9963822ea05f8447c1ec71b50db992f3bf456370e00ae59055c939df1817c0031cdfbbfddbcdae9c448790fdcd67df10589b43d
2023-10-30 13:26:32 +01:00
edouardparis
1cbbb8c0be wallet: load name from settings 2023-10-30 13:26:21 +01:00