dcrlnd icon indicating copy to clipboard operation
dcrlnd copied to clipboard

Breach arbiter should watch for spends that invalidate justice tx

Open matheusd opened this issue 4 years ago • 0 comments

When publishing the justice transaction (https://github.com/decred/dcrlnd/blob/29759788a0212a4777aac8a7bd0f4410a9a9b3a6/breacharbiter.go#L572-L573) if the transaction is successfully published the breach arbiter assumes the transaction will be mined.

However it might be the case that one of the inputs gets double spent making the justice tx invalid. One way this can happen is in SPV mode where the transaction fails to be relayed in time and a different second-level htlc transaction is published.

The breach arbiter should watch for spends of the inputs of the justice transaction and craft a different justice tx even if the original publishing was correct.

Fixing this will allow enabling the "testRevokedCloseRetributionRemoteHodlSecondLevel" test for the SPV backend.

matheusd avatar Apr 03 '20 14:04 matheusd