1
0
Fork 0
mirror of https://github.com/ACINQ/eclair.git synced 2025-02-21 22:11:46 +01:00

Relax assumptions about gossip_queries (#2842)

https://github.com/lightning/bolts/pull/1092 initially made the
`gossip_queries` feature mandatory and assumed: however it generally
doesn't make sense for mobile wallets. It was thus relaxed in the last
commits of this BOLTs PR, so we revert our change to `mandatory` to
make this optional and avoid sending gossip queries to nodes who don't
activate the feature.
This commit is contained in:
Bastien Teinturier 2024-04-16 17:45:24 +02:00 committed by GitHub
parent 7ab42bfad5
commit c6e586ab89
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 7 additions and 5 deletions

View file

@ -57,7 +57,7 @@ eclair {
// Make sure you understand what it implies before you activate this feature.
option_upfront_shutdown_script = disabled
option_data_loss_protect = mandatory
gossip_queries = mandatory
gossip_queries = optional
gossip_queries_ex = optional
var_onion_optin = mandatory
option_static_remotekey = mandatory

View file

@ -394,11 +394,13 @@ class PeerConnection(keyPair: KeyPair, conf: PeerConnection.Conf, switchboard: A
stay() using d.copy(behavior = behavior1)
case Event(DoSync(replacePrevious), d: ConnectedData) =>
// We assume support for standard range queries since https://github.com/lightning/bolts/pull/1092
val canUseChannelRangeQueries = Features.canUseFeature(d.localInit.features, d.remoteInit.features, Features.ChannelRangeQueries)
val canUseChannelRangeQueriesEx = Features.canUseFeature(d.localInit.features, d.remoteInit.features, Features.ChannelRangeQueriesExtended)
val flags_opt = if (canUseChannelRangeQueriesEx) Some(QueryChannelRangeTlv.QueryFlags(QueryChannelRangeTlv.QueryFlags.WANT_ALL)) else None
log.debug(s"sending sync channel range query with flags_opt=$flags_opt replacePrevious=$replacePrevious")
router ! SendChannelQuery(d.chainHash, d.remoteNodeId, self, replacePrevious, flags_opt)
if (canUseChannelRangeQueries || canUseChannelRangeQueriesEx) {
val flags_opt = if (canUseChannelRangeQueriesEx) Some(QueryChannelRangeTlv.QueryFlags(QueryChannelRangeTlv.QueryFlags.WANT_ALL)) else None
log.debug(s"sending sync channel range query with flags_opt=$flags_opt replacePrevious=$replacePrevious")
router ! SendChannelQuery(d.chainHash, d.remoteNodeId, self, replacePrevious, flags_opt)
}
stay()
case Event(ResumeAnnouncements, d: ConnectedData) =>