GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — fix: leave room for the funding fee and change in the auto channel open wallet clamp by markettes · Pull Request #621 · Lunar-Rails/NodeGuard

Conversation

@markettes

@markettes markettes commented Oct 7, 2026

Copy link
Copy Markdown
Contributor

Description:

  • The wallet clamp no longer sizes a channel to the wallet's whole confirmed balance. It now leaves room for the funding fee plus a 546 sat change output, so the open doesn't fail with negative or dust change.
  • New LightningHelper.MaxFundableChannelSats uses NBitcoin to size the transaction the open actually builds: every available coin in, a funding output and a change output out, priced at HourFee.
  • AutoChannelOpenJob takes its coins from ICoinSelectionService, so coins locked by other requests and frozen ones no longer count. Unit tests cover single-sig, multisig and a wallet too small to fund a channel; a new E2E scenario opens a channel that the wallet clamp sized.
  • The existing auto-open E2E scenario now expects the fee the sender actually offered, matching the planner since commit d4a6771. Shared test UTXO setup moved to TestUtxos.

Stack created with GitHub Stacks CLI • Give Feedback 💬

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
markettes added 2 commits October 7, 2026 15:33
@markettes
fix: update wallet funding logic to ensure fees and dust change are a…
05c874c
…ccounted for
@markettes
test: add e2e for this case
5bb1c3e
@markettes
markettes added this pull request to stack #617 October 7, 2026 13:51
This was referenced Oct 30, 2026
Channel open recommendations: data model and per-node settings #659
Open
Auto channel open: recommend a fixed-size channel to earning peers that run out of outbound #660
Open
lunar-patrol[bot]
lunar-patrol Bot reviewed Nov 24, 2026
View reviewed changes

@lunar-patrol lunar-patrol Bot left a comment

Copy link
Copy Markdown

There was a problem hiding this comment.

Choose a reason for hiding this comment

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

🔒 Automated security review — no issues found

The PR changes AutoChannelOpenJob to clamp channel size against the wallet's max fundable amount (coins minus estimated funding fee and a dust change output) instead of the raw confirmed balance, using a new LightningHelper.MaxFundableChannelSats and ICoinSelectionService for spendable UTXOs. All inputs come from the operator's own node configuration, NBXplorer's view of the wallet, and internally computed fee rates — no request, message-bus, or other attacker-controlled input reaches the new code, and the fee sizing is verified against NBitcoin's builder for both single-sig and multisig wallets in tests. I found no exploitable defect.

Reviewed 9 files at 5bb1c3e. Nothing to report.

Not a guarantee — one diff, no knowledge of your threat model.

🤖 Automated security review. It never pushes, approves or blocks; a suggestion applies only when you click Commit suggestion.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
@markettes
markettes marked this pull request as draft November 25, 2026 12:09

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

Copilot code review Copilot
Copilot will automatically review once the pull request is marked ready for review
1 more reviewer
@lunar-patrol lunar-patrol[bot] lunar-patrol[bot] left review comments
Reviewers whose approvals may not affect merge requirements

At least 1 approving review is required to merge this pull request.

Uh oh!

There was an error while loading. Please reload this page.

Assignees

No one assigned

Labels

None yet

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

Uh oh!

There was an error while loading. Please reload this page.

1 participant

@markettes
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
You are visitor 01402775 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.