What changed, and why it matters
This commit is a small internal code cleanup. It changes one function to use a different internal data type for HTLC (payment channel transaction) information, moving from a database-specific type to a channel-state type. There is no security-relevant change visible in the diff.
No security action required. Treat as routine refactoring.
Security signals we found
No strong security signals were identified.
Evidence from the diff
The patch modifies preimageBeacon.SubscribeUpdates and its tests to accept *chanstate.HTLC instead of *channeldb.HTLC. The commit message frames this as removing a ‘channel DB compatibility alias for HTLC payloads.’ No logic, validation, serialization, or access-control behavior changes are present in the diff.
Changed components
witness_beacon.gowitness_beacon_test.goInspect captured patch +5 / −4
diff --git a/witness_beacon.go b/witness_beacon.go
index 68c096a..c1ccc63 100644
--- a/witness_beacon.go
+++ b/witness_beacon.go
@@ -5,6 +5,7 @@ import (
"sync"
"github.com/lightningnetwork/lnd/channeldb"
+ "github.com/lightningnetwork/lnd/chanstate"
"github.com/lightningnetwork/lnd/contractcourt"
"github.com/lightningnetwork/lnd/fn/v2"
"github.com/lightningnetwork/lnd/graph/db/models"
@@ -64,7 +65,7 @@ func newPreimageBeacon(wCache witnessCache,
// SubscribeUpdates returns a channel that will be sent upon *each* time a new
// preimage is discovered.
func (p *preimageBeacon) SubscribeUpdates(
- chanID lnwire.ShortChannelID, htlc *channeldb.HTLC,
+ chanID lnwire.ShortChannelID, htlc *chanstate.HTLC,
payload *hop.Payload,
nextHopOnionBlob []byte) (*contractcourt.WitnessSubscription, error) {
diff --git a/witness_beacon_test.go b/witness_beacon_test.go
index 1edbada..7ba22db 100644
--- a/witness_beacon_test.go
+++ b/witness_beacon_test.go
@@ -4,7 +4,7 @@ import (
"errors"
"testing"
- "github.com/lightningnetwork/lnd/channeldb"
+ "github.com/lightningnetwork/lnd/chanstate"
"github.com/lightningnetwork/lnd/graph/db/models"
"github.com/lightningnetwork/lnd/htlcswitch"
"github.com/lightningnetwork/lnd/htlcswitch/hop"
@@ -38,7 +38,7 @@ func TestWitnessBeaconIntercept(t *testing.T) {
subscription, err := p.SubscribeUpdates(
lnwire.NewShortChanIDFromInt(1),
- &channeldb.HTLC{
+ &chanstate.HTLC{
RHash: hash,
},
&hop.Payload{},
@@ -76,7 +76,7 @@ func TestWitnessBeaconInterceptErrorCancels(t *testing.T) {
)
chanID := lnwire.NewShortChanIDFromInt(1)
- htlc := &channeldb.HTLC{
+ htlc := &chanstate.HTLC{
HtlcIndex: 2,
RHash: lntypes.Hash{3},
}
Why this scored 15/100
Community notes
Notes can correct, qualify, or add evidence to the AI analysis. Every note shown here has been validated by a human moderator.
The AI analysis stands alone for now. Submit a note if you can add evidence or important context.