1
0
mirror of https://github.com/ACINQ/eclair.git synced 2024-11-19 18:10:42 +01:00

Do not store CannotAffordFees errors (#1834)

That error can get spammy because it will be emitted at every block for
every channel, and it doesn't bring a lot of value to store it anyway.
This commit is contained in:
Pierre-Marie Padiou 2021-06-07 14:54:46 +02:00 committed by GitHub
parent bd6bad1bfd
commit a7bb2c2b24
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -83,12 +83,17 @@ class DbEventHandler(nodeParams: NodeParams) extends Actor with ActorLogging {
case e: NetworkFeePaid => auditDb.add(e)
case e: ChannelErrorOccurred =>
// first pattern matching level is to ignore some errors, second level is to separate between different kind of errors
e.error match {
case LocalError(_) if e.isFatal => ChannelMetrics.ChannelErrors.withTag(ChannelTags.Origin, ChannelTags.Origins.Local).withTag(ChannelTags.Fatal, value = true).increment()
case LocalError(_) if !e.isFatal => ChannelMetrics.ChannelErrors.withTag(ChannelTags.Origin, ChannelTags.Origins.Local).withTag(ChannelTags.Fatal, value = false).increment()
case RemoteError(_) => ChannelMetrics.ChannelErrors.withTag(ChannelTags.Origin, ChannelTags.Origins.Remote).increment()
case LocalError(_: CannotAffordFees) => () // will be thrown at each new block if our balance is too low to update the commitment fee
case _ =>
e.error match {
case LocalError(_) if e.isFatal => ChannelMetrics.ChannelErrors.withTag(ChannelTags.Origin, ChannelTags.Origins.Local).withTag(ChannelTags.Fatal, value = true).increment()
case LocalError(_) if !e.isFatal => ChannelMetrics.ChannelErrors.withTag(ChannelTags.Origin, ChannelTags.Origins.Local).withTag(ChannelTags.Fatal, value = false).increment()
case RemoteError(_) => ChannelMetrics.ChannelErrors.withTag(ChannelTags.Origin, ChannelTags.Origins.Remote).increment()
}
auditDb.add(e)
}
auditDb.add(e)
case e: ChannelStateChanged =>
// NB: order matters!