Skip to content
This repository has been archived by the owner on Jul 20, 2023. It is now read-only.

Commit

Permalink
only update gossip data for current channels if recent.
Browse files Browse the repository at this point in the history
a dirty fix to #34 that is probably being
caused by some node somewhere, probably acinq, sending very old `node_announcement`
messages in reply to our naïve queries.
  • Loading branch information
fiatjaf committed Dec 31, 2022
1 parent 53ee593 commit 1d61e80
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions app/src/main/scala/HubActivity.scala
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package wtf.nbd.obw

import java.util.TimerTask
import java.util.{TimerTask, Date}
import scala.util.chaining._
import scala.jdk.CollectionConverters._
import scala.collection.immutable.Seq
Expand Down Expand Up @@ -2150,8 +2150,9 @@ class HubActivity

// Getting graph sync status and our peer announcements
override def process(reply: Any): Unit = reply match {
case na: NodeAnnouncement =>
LNParams.cm.all.values.foreach(_.process(na.toRemoteInfo))
case na: NodeAnnouncement
if na.timestamp > ((new Date().getTime() / 1000) - 60 * 60 * 24 * 30) =>
LNParams.cm.all.values.foreach(_.process(na))
case PathFinder.CMDResync =>
walletCards.updateLnSyncProgress(total = 1000, left = 1000)
case prd: PureRoutingData =>
Expand Down

0 comments on commit 1d61e80

Please sign in to comment.