1
0
Fork 0
mirror of https://github.com/ACINQ/eclair.git synced 2025-02-23 06:35:11 +01:00

now looking for revoked tx starting from the latest

This commit is contained in:
pm47 2015-09-09 14:37:45 +02:00
parent 6bbffd1f84
commit 9114fd72bd

View file

@ -973,7 +973,7 @@ class Node(val blockchain: ActorRef, val params: OurChannelParams, val anchorDat
case None =>
// it has to be one of the revoked tx
// one way is to use the main revocation hash, and rebuild the pub script we signed
(0L until commitment.index)
(commitment.index - 1 to 0L by -1)
.find { i =>
val theirRevocationHash = Crypto.sha256(ShaChain.getHash(shaChain, i).get)
publishedTx.txOut.exists(o => o.publicKeyScript.data.toArray.deep == Script.write(pay2sh(redeemSecretOrDelay(theirParams.finalPubKey, ourParams.delay, ourFinalPubKey, theirRevocationHash))).deep)