1
0
Fork 0
mirror of https://github.com/ACINQ/eclair.git synced 2025-03-13 19:37:35 +01:00

Take mutual close txes into account in bg check (#1621)

We have a background task that periodically checks the blockchain to
detect unexpected transactions, as they could be cheating attempts.

When cooperatively closing a channel, in the `NEGOTIATING` state, peers
exchange signatures in order to converge on a feerate for the mutual
close transaction. Any transaction exchanged during this negotiation
process is valid and may be published, even if the counterparty dies
abruptly before converging, due to e.g. connectivity issues.

Therefore, the electrum background check needs to take those
transactions into account and not flag them as potential cheating
attempts. We already do that when we are in the `CLOSING` state, as
there may be competing mutual closes.
This commit is contained in:
Pierre-Marie Padiou 2020-11-30 12:47:26 +01:00 committed by GitHub
parent 74e6576f87
commit 339fe1c9f4
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -152,6 +152,7 @@ class BasicWatcher(client: ActorRef, channels: Seq[HasCommitments], pWatchResult
// we know those transactions are ok
val okTxes = channels.flatMap {
case d: DATA_CLOSING => WatchListener.okTransactions(d.commitments) ++ d.mutualCloseProposed.map(_.txid)
case d: DATA_NEGOTIATING => WatchListener.okTransactions(d.commitments) ++ d.closingTxProposed.flatten.map(_.unsignedTx.txid)
case d: HasCommitments => WatchListener.okTransactions(d.commitments)
}.toSet