lnd/autopilot
Elle Mouton 3fe40c6540
graph/db: add v2 fields to ChannelEdgePolicy model
Extend ChannelEdgePolicy to support v2 channel updates by adding:

- Version field to track gossip protocol version (v1 or v2).
- LastBlockHeight for v2's block-height-based timestamps.
- SecondPeer flag to indicate which peer announced the policy in v2.
- DisableFlags for v2-specific channel disable signaling.
- ExtraSignedFields map for v2 extra signed TLV data.

Add version-aware methods:
- IsNode1() determines if the policy was announced by node_1, handling
  both v1 (via ChannelFlags direction bit) and v2 (via SecondPeer).
- IsDisabled() checks disable status using ChannelFlags for v1 and
  DisableFlags for v2.
- String() provides version-appropriate string representations.

The new fields use zero values for v1 compatibility (Version defaults
to GossipVersion1, LastBlockHeight to 0, SecondPeer to false). This
lays the groundwork for v2 policy support; a subsequent commit will
handle reading and writing these fields from/to the database.
2026-02-13 07:21:24 +02:00
..
agent.go autopilot: fix nil map assignment 2025-09-18 07:37:53 +02:00
agent_constraints.go trivial: Fix spelling errors 2023-09-21 22:35:33 -04:00
agent_constraints_test.go multi: use btcd's btcec/v2 and btcutil modules 2022-03-09 19:02:37 +01:00
agent_test.go autopilot: revert passing ctx to Start methods 2025-05-22 14:14:40 +02:00
betweenness_centrality.go autopilot: continue threading context 2025-05-22 14:14:38 +02:00
betweenness_centrality_test.go multi: context.Background() -> t.Context() 2025-08-30 14:13:44 -03:00
centrality_testdata_test.go multi: use btcd's btcec/v2 and btcutil modules 2022-03-09 19:02:37 +01:00
choice.go multi: Fix typos [skip ci] 2022-01-24 12:19:02 +02:00
choice_test.go chore: fix struct names 2024-04-17 11:19:31 +08:00
combinedattach.go autopilot: update AttachmentHeuristics with context 2025-05-22 14:14:38 +02:00
externalscoreattach.go autopilot: update AttachmentHeuristics with context 2025-05-22 14:14:38 +02:00
externalscoreattach_test.go multi: context.Background() -> t.Context() 2025-08-30 14:13:44 -03:00
graph.go multi: rename models.LightningNode to models.Node 2025-09-03 10:14:35 +02:00
graph_test.go multi: use btcd's btcec/v2 and btcutil modules 2022-03-09 19:02:37 +01:00
interface.go multi: rename models.LightningNode to models.Node 2025-09-03 10:14:35 +02:00
log.go multi: start updating various loggers to use the new v2 type 2024-10-22 17:03:55 +02:00
manager.go autopilot: revert passing ctx to Start methods 2025-05-22 14:14:40 +02:00
prefattach.go autopilot: remove the ForEachChannel method from Node interface 2025-08-06 09:52:09 +02:00
prefattach_test.go graph/db: add v2 fields to ChannelEdgePolicy model 2026-02-13 07:21:24 +02:00
setup_test.go multi: use MakeTestGraph everywhere for test graph creation 2025-05-22 14:14:42 +02:00
simple_graph.go autopilot: remove the ForEachChannel method from Node interface 2025-08-06 09:52:09 +02:00
simple_graph_test.go lnrpc+autopilot: add graph diameter calculation 2022-03-07 11:15:47 +01:00
top_centrality.go autopilot: update AttachmentHeuristics with context 2025-05-22 14:14:38 +02:00
top_centrality_test.go multi: context.Background() -> t.Context() 2025-08-30 14:13:44 -03:00