From 84abc962c4dbd99e24ff7ba71f401784675e50bb Mon Sep 17 00:00:00 2001 From: Conner Fromknecht Date: Wed, 6 Sep 2017 13:39:45 -0700 Subject: [PATCH] lnwallet/witnessgen: adds htlc offered+accepted revoke witness type --- lnwallet/witnessgen.go | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/lnwallet/witnessgen.go b/lnwallet/witnessgen.go index ad5e139ce..434bff4e7 100644 --- a/lnwallet/witnessgen.go +++ b/lnwallet/witnessgen.go @@ -25,6 +25,14 @@ const ( // of a malicious counterparty's who broadcasts a revoked commitment // transaction. CommitmentRevoke WitnessType = 2 + + // HtlcOfferedRevoke is a witness that allows us to sweep an HTLC + // output that we offered to the counterparty. + HtlcOfferedRevoke WitnessType = 3 + + // HtlcAcceptedRevoke is a witness that allows us to sweep an HTLC + // output that we accepted from the counterparty. + HtlcAcceptedRevoke WitnessType = 4 ) // WitnessGenerator represents a function which is able to generate the final @@ -52,6 +60,10 @@ func (wt WitnessType) GenWitnessFunc(signer Signer, return CommitSpendNoDelay(signer, desc, tx) case CommitmentRevoke: return CommitSpendRevoke(signer, desc, tx) + case HtlcOfferedRevoke: + return ReceiverHtlcSpendRevoke(signer, desc, tx) + case HtlcAcceptedRevoke: + return SenderHtlcSpendRevoke(signer, desc, tx) default: return nil, fmt.Errorf("unknown witness type: %v", wt) }