1276 Commits

Author SHA1 Message Date
edouardparis
3372e2f1e0 gui: grey out hws with addr verif unimplemented 2023-12-07 14:39:45 +01:00
edouardparis
0ef49ed3f7 gui: grey out unrelated hws 2023-12-06 16:44:25 +01:00
Antoine Poinsot
bcfab48c39
Merge #828: gui: installer: clearer placeholder in xpub edit field
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
2023-12-04 11:49:54 +01:00
edouardparis
7011210fc2
Merge #825: handle psbt missing input coins
40ade751e0a00cde2a8eec3260eb267534a75f61 Fix transactions Labelled methods (edouardparis)
b4729c37286a1e1fc7584b935a47f458a2c8aef9 Split inputs and outputs view (edouardparis)
946e499b5a1f0f340169ace8228bddb451a8a7a2 Handle missing coin inputs in tx and psbt (edouardparis)

Pull request description:

ACKs for top commit:
  jp1ac4:
    ACK 40ade751e0.

Tree-SHA512: b823b78d0730a1b23a0df4834b7a622f767119a63e6f0e86cb61eb4d422fbcfcd182f5a4726d7140f444fe0cf1722c774026091ad15a11aadea8542f875dd278
2023-11-28 13:44:34 +01:00
edouardparis
40ade751e0 Fix transactions Labelled methods
Better to use the input previous output
field instead of relying of possible missing
coin.
2023-11-28 13:08:35 +01:00
edouardparis
b4729c3728 Split inputs and outputs view
Inputs does not need to be displayed
for external incoming transactions
2023-11-28 13:07:35 +01:00
edouardparis
946e499b5a Handle missing coin inputs in tx and psbt
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.
2023-11-27 17:48:35 +01:00
Antoine Poinsot
7bfc53890a
Merge #821: Make it possible to create a sweep transaction using createspend
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
2023-11-24 18:24:52 +01:00
Antoine Poinsot
6bd6218d64
qa: demonstrate sweep functionality using createpsbt's change_address 2023-11-24 13:51:43 +01:00
Antoine Poinsot
a77a36cb9e
commands: make it possible to create a sweep spend transaction
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.
2023-11-24 13:51:42 +01:00
Antoine Poinsot
cecc1a040c
Merge #832: commands: require change for self-send
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
2023-11-24 11:37:21 +01:00
jp1ac4
6123b87a02
commands: fix documentation 2023-11-24 10:10:22 +00:00
jp1ac4
b8fd97fc83
commands: require change for self-send
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.
2023-11-24 10:10:22 +00:00
Antoine Poinsot
ed35a796ff
Merge #829: bitcoin: poller: fix spend expiration from mempool, again
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
2023-11-21 13:29:02 +01:00
Antoine Poinsot
758a4d6578
bitcoin: poller: fix spend expiration from mempool, again
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.
2023-11-21 11:20:20 +01:00
Antoine Poinsot
3077062c84
gui: installer: clearer placeholder in xpub edit field
I'm not sure what rustfmt is doing here.

Fixes #451.
2023-11-20 19:16:57 +01:00
Antoine Poinsot
1df4ab8f07
Merge #819: Verify receive address
e9a217b3d87fc5ccd284df33fc58f877c7a5103e Add verify address modal to receive panel (edouardparis)
fa992aa5649ec406eb696437c86f9bc781d5a0b8 gui: move receive panel to its own file (edouardparis)

Pull request description:

ACKs for top commit:
  jp1ac4:
    utACK e9a217b3d8.

Tree-SHA512: 4b34260304f6417146c920861c63f4c4f5f9823a3f73538a398eba0144dee9c4630fe91007dfc34ae07e5957926cc30464abd8c55679b899dc9612e8aa4d98ce
2023-11-20 17:42:08 +01:00
edouardparis
e9a217b3d8 Add verify address modal to receive panel
bump async-hwi v0.0.13
2023-11-20 15:30:37 +01:00
edouardparis
fa992aa564 gui: move receive panel to its own file 2023-11-20 15:10:25 +01:00
Antoine Poinsot
f512f3c511
Merge #824: qa: fix flaky test of unconfirmed spend RBF
6b5fc2d1faf94d8290a30bd7007113815c8936ea qa: fix flaky test of unconfirmed spend RBF (Antoine Poinsot)

Pull request description:

  Since #617 the spend info for a coin may be wiped from the DB. Be robust to a temporarily `None` spend info in the functional test.

  See for instance https://github.com/wizardsardine/liana/runs/18785511349.

ACKs for top commit:
  darosior:
    ACK 6b5fc2d1faf94d8290a30bd7007113815c8936ea -- trivial and i've run this test a few dozen times concurrently locally to make sure it's unflaked.

Tree-SHA512: 7470a1fd4c16ee7af6ee4c9d9e57271f5f18ac728062cc937a366681534714ec404f2b8e0a58e0d5f51a7461e28dcae6d93f49e5fc0f45297eae9b979e821f86
2023-11-20 14:56:22 +01:00
Antoine Poinsot
6b5fc2d1fa
qa: fix flaky test of unconfirmed spend RBF 2023-11-20 14:53:03 +01:00
Antoine Poinsot
38b851e188
Merge #817: Bitcoin state poller: a bug fix and a few RBF handling improvements
317ab964f707f049e51bbb4be7ae32975ca3da45 bitcoin: add a comment about the new spend detection logic (Antoine Poinsot)
6daf7ac2603a4a4f588e6106d3c4398228113b97 poller: don't check spending status of expired coins (Antoine Poinsot)
0e5634ce5986d70ab703f639882e35bba6ee571f bitcoin: poller: document where RBF is handled for spends (Antoine Poinsot)
cf7c4fbac96c421c311fd86255cdea26394954e3 bitcoin: drop spend txid for coins whose spending tx gets RBF'd (Antoine Poinsot)
544167dee4c631b324848d9f558ba48504582018 bitcoin: mark coins whose spending tx got double spent as unspent again (Antoine Poinsot)
f78e831c39311cd5d758ea81d6e855a85d13fa5c db: make it possible to mark coins back as unspent (Antoine Poinsot)
c30bc8cd18ac77f64179a8794a26770c68eb4916 bitcoin: optimize spend conflict confirmation lookup (Antoine Poinsot)
bc25addf342d5f570eb20f97b0413bb7109f0be9 bitcoin: don't assign incorrect spend_txid on conflict tx confirmation (Antoine Poinsot)
20ab30924fbdf62bb3886b2da75fe8c57555d2b6 qa: add a test describing current poller behaviour wrt replacements (Antoine Poinsot)

Pull request description:

  We start by illustrating the current logic of the poller with regard to replacements in a functional test. This exposes a bug: we could incorrectly assign a transaction which conflicts with a spend transaction for one of our coin as spending this coin whereas it in fact didn't.

  After fixing this bug, we proceed to make it possible to wipe the spending status back to unspent. First when a conflict is mined, then also when it's only accepted into our mempool. This matches how we treat replacements for deposit transactions.

ACKs for top commit:
  jp1ac4:
    ACK 317ab964f7.

Tree-SHA512: bfad864cf03947e5d42894de12ae281a8cff10964d299df5b6b74310efbe6bbefb347349b2d421f1fb3e9470fa929fd7c2c221c9f161dd602757f75b66355ea0
2023-11-17 14:25:20 +01:00
Antoine Poinsot
639cac7bf3
Merge #563: gui: Add automated coin selection for spend
9e2407eb8a75bc59c16659bf4aa80f8adef0e3d2 gui: auto-select coins for spend (jp1ac4)

Pull request description:

  This adds automated coin selection from #560 to the GUI.

  The new "Auto-select" button uses automated coin selection to select coins for a spend, which the user can then modify as required.

  The button can only be clicked once the recipients and feerate have been validated, and it does not appear when creating a self-send.

  I haven't added any validation on the amount before making the button clickable, but it may be hard to anticipate all coin selection errors once fees are taken into consideration.

ACKs for top commit:
  darosior:
    light ACK 9e2407eb8a75bc59c16659bf4aa80f8adef0e3d2

Tree-SHA512: 6ce3389d849470b3beb6ac8df75d2c3b7b6c04ee881dd0e9116c4d87f54376a8ed6666cbfd0ff0152a3eb839c8f7f17a175fe078ef030f03451430b84ab40cb6
2023-11-17 14:24:06 +01:00
Antoine Poinsot
317ab964f7
bitcoin: add a comment about the new spend detection logic 2023-11-17 13:53:02 +01:00
Antoine Poinsot
6daf7ac260
poller: don't check spending status of expired coins
If the deposit tx itself isn't in mempool anymore, it's always going to
fail. Avoid needless work and error log.
2023-11-17 13:53:01 +01:00
Antoine Poinsot
0e5634ce59
bitcoin: poller: document where RBF is handled for spends 2023-11-17 13:53:00 +01:00
Antoine Poinsot
cf7c4fbac9
bitcoin: drop spend txid for coins whose spending tx gets RBF'd
Even if the RBF does not spend this coin anymore.
2023-11-17 13:53:00 +01:00
Antoine Poinsot
544167dee4
bitcoin: mark coins whose spending tx got double spent as unspent again 2023-11-17 13:52:59 +01:00
Antoine Poinsot
f78e831c39
db: make it possible to mark coins back as unspent 2023-11-17 13:52:59 +01:00
Antoine Poinsot
c30bc8cd18
bitcoin: optimize spend conflict confirmation lookup
Make it possible to break immediately if it's found.
2023-11-17 13:52:58 +01:00
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
jp1ac4
9e2407eb8a
gui: auto-select coins for spend 2023-11-15 20:01:30 +00: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