Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

bugfix: Return early if no non-static outputs #137

Merged

Conversation

MaxFangX
Copy link
Contributor

@MaxFangX MaxFangX commented Jul 5, 2023

If there is a cooperative closure, there will only be one output to spend, and it will be a StaticOutput. Since WalletKeysManager::spend_spendable_outputs filters out static outputs, KeysManager::spend_spendable_outputs gets passed an empty list of descriptors to spend, which results in an error (with no further information provided).

Copy link
Collaborator

@tnull tnull left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah, good catch. I wonder if a similar change should land upstream, but for now this makes sense to me.

src/event.rs Outdated Show resolved Hide resolved
If there is a cooperative closure, there will only be one output to
spend, and it will be a `StaticOutput`. Since `WalletKeysManager`'s
`spend_spendable_outputs` filters out static outputs, `KeysManager`'s
`spend_spendable_outputs` gets passed an empty list of descriptors to
spend, which results in an error (with no further information provided).
@MaxFangX MaxFangX force-pushed the max/fix-spend-spendable-outputs branch from 1750be4 to ccf347c Compare July 5, 2023 17:30
@MaxFangX
Copy link
Contributor Author

MaxFangX commented Jul 5, 2023

I wonder if a similar change should land upstream

It would be better if KeysManager::spend_spendable_outputs' Err contained more information than just (). I ran into this problem when integration testing cooperative closes, and guessed (correctly) it was because of all of the static outputs being filtered out. With explicit errors the problem would have been more obvious.

@tnull tnull merged commit 77acd3b into lightningdevkit:main Jul 6, 2023
3 checks passed
@MaxFangX MaxFangX deleted the max/fix-spend-spendable-outputs branch July 6, 2023 13:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants