Skip to content

Commit b6aa4cc

Browse files
Log balance estimate updates (#2994)
This will allow us to try different algorithms to estimate the balance and evaluate them on historical data.
1 parent 03ba2f8 commit b6aa4cc

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

eclair-core/src/main/scala/fr/acinq/eclair/router/BalanceEstimate.scala

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -284,6 +284,7 @@ case class BalancesEstimates(balances: Map[(PublicKey, PublicKey), BalanceEstima
284284
)
285285

286286
def channelCouldSend(hop: ChannelHop, amount: MilliSatoshi)(implicit log: LoggingAdapter): BalancesEstimates = {
287+
log.info("channelCouldSend: amount={} scid={} from={} to={}", amount, hop.shortChannelId, hop.nodeId, hop.nextNodeId)
287288
get(hop.nodeId, hop.nextNodeId).foreach { balance =>
288289
val estimatedProbability = balance.canSend(amount, TimestampSecond.now())
289290
Monitoring.Metrics.remoteEdgeRelaySuccess(estimatedProbability)
@@ -292,6 +293,7 @@ case class BalancesEstimates(balances: Map[(PublicKey, PublicKey), BalanceEstima
292293
}
293294

294295
def channelCouldNotSend(hop: ChannelHop, amount: MilliSatoshi)(implicit log: LoggingAdapter): BalancesEstimates = {
296+
log.info("channelCouldNotSend: amount={} scid={} from={} to={}", amount, hop.shortChannelId, hop.nodeId, hop.nextNodeId)
295297
get(hop.nodeId, hop.nextNodeId).foreach { balance =>
296298
val estimatedProbability = balance.canSend(amount, TimestampSecond.now())
297299
Monitoring.Metrics.remoteEdgeRelayFailure(estimatedProbability)
@@ -300,6 +302,7 @@ case class BalancesEstimates(balances: Map[(PublicKey, PublicKey), BalanceEstima
300302
}
301303

302304
def channelDidSend(hop: ChannelHop, amount: MilliSatoshi)(implicit log: LoggingAdapter): BalancesEstimates = {
305+
log.info("channelDidSend: amount={} scid={} from={} to={}", amount, hop.shortChannelId, hop.nodeId, hop.nextNodeId)
303306
get(hop.nodeId, hop.nextNodeId).foreach { balance =>
304307
val estimatedProbability = balance.canSend(amount, TimestampSecond.now())
305308
Monitoring.Metrics.remoteEdgeRelaySuccess(estimatedProbability)

0 commit comments

Comments
 (0)