-
Notifications
You must be signed in to change notification settings - Fork 276
Description
In #2936, we changed WatchExternalChannelSpent to be a WatchSpent instead of a WatchSpentBasic. One of the consequences is that whenever we receive a channel_announcement, we will call checkSpent:
eclair/eclair-core/src/main/scala/fr/acinq/eclair/blockchain/bitcoind/ZmqWatcher.scala
Line 378 in 27ba60f
| private def checkSpent(w: WatchSpent[_ <: WatchSpentTriggered]): Future[Unit] = { |
If the announcement is from a utxo that has been spent a long time ago, we go through client.lookForSpendingTx which iterates over blocks and is very inefficient. It's important to go through this process for our own channels, but for external channels this can be used as a DoS vector.
I'm not sure what exactly we should do: if we don't look into the blockchain, we won't find the spending tx and thus cannot wait 12 blocks before removing the channel. But if we look into the blockchain, that's expensive and can be abused...