blockchain / thunder

Off-Chain Bitcoin payments using smart contracts

Home Page:https://blockchain.com/thunder

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Claim funds after other party cheated

matsjj opened this issue · comments

BlockchainWatcherImpl implements the general behaviour of watching the blockchain and detecting if the anchor has been spent.

What is still missing is analysing the status quo when detecting a spent anchor and acting accordingly. We need to implement logic that compares the state of the latest ChannelStatus with the transaction that spends the anchor AND is sufficiently deep buried in the blockchain.

If it turns out it is an older version, we have to broadcast transactions, claiming the funds from both parties using the RevocationHash.

If the anchor pays to two P2PKH addresses, it means the channel has been closed friendly, so we don't need to check these.