Allow selecting coins in sendcoins#8955
Conversation
|
Important Review skippedAuto reviews are limited to specific labels. Labels to auto review (1)
Please check the settings in the CodeRabbit UI or the You can disable this status message by setting the Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media? TipsChatThere are 3 ways to chat with CodeRabbit:
Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (invoked as PR comments)
Additionally, you can add CodeRabbit Configuration File (
|
hieblmi
left a comment
There was a problem hiding this comment.
Thanks for picking this up @yyforyongyu! I've checked out the test cases you added and left a suggestion. Since the original commits did not change and were already approved I will only aim for a tAck in my next review round.
|
|
||
| // Since the first two UTXOs have been sent to an address outside her | ||
| // wallet, Alice should see a single UTXO now. | ||
| ht.AssertNumUTXOs(alice, 1) |
There was a problem hiding this comment.
Could we further check that the remaining coin can't be selected and spent in its entirety so that the required reserves are not violated?
On this note, should the API allow to spend the coin up until the required reserve and not return an error unless other constraints like the dust limit of the sending amount are reached? Maybe further tests can document behavior here as well.
There was a problem hiding this comment.
yeah I like it, added a test to show how it behaves atm.
guggero
left a comment
There was a problem hiding this comment.
Not too far off I think, mainly some code style changes on the wish list.
|
|
||
| // Use select utxos, if provided. | ||
| if len(selectUtxos) > 0 { | ||
| utxos, err = fetchUtxosFromOutpoints(utxos, |
6ccb920 to
0cb2739
Compare
| // also checks that change outputs will be created automatically if `SendAll` | ||
| // flag is set. | ||
| func testSendSelectedCoinsChannelReserve(ht *lntest.HarnessTest) { | ||
| chanAmt := btcutil.Amount(100000) |
| tx := ht.GetNumTxsFromMempool(1)[0] | ||
|
|
||
| // Assert the tx has the expected shape. It should have 2 inputs and 2 | ||
| // output. |
Signed-off-by: Ononiwu Maureen <59079323+Chinwendu20@users.noreply.github.com>
This commit updates the interface methods from `lnwallet.WalletController` to take optional input set which can be used to create the tx.
Signed-off-by: Ononiwu Maureen <59079323+Chinwendu20@users.noreply.github.com>
Signed-off-by: Ononiwu Maureen <59079323+Chinwendu20@users.noreply.github.com>
Signed-off-by: Ononiwu Maureen <59079323+Chinwendu20@users.noreply.github.com>
Also rename the send all coins test for clarity.
0cb2739 to
dcd8269
Compare
| }, | ||
| cli.BoolFlag{ | ||
| Name: "sweepall", | ||
| Usage: "if set, then the amount field will be ignored, " + |
This comment was marked as off-topic.
This comment was marked as off-topic.
Sorry, something went wrong.
Replaces #8516, fixes #6949