mirror of
https://github.com/lightningnetwork/lnd.git
synced 2025-10-05 19:04:27 +02:00
lnwallet/witnessgen: adds htlc offered+accepted revoke witness type
This commit is contained in:
@@ -25,6 +25,14 @@ const (
|
|||||||
// of a malicious counterparty's who broadcasts a revoked commitment
|
// of a malicious counterparty's who broadcasts a revoked commitment
|
||||||
// transaction.
|
// transaction.
|
||||||
CommitmentRevoke WitnessType = 2
|
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
|
// 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)
|
return CommitSpendNoDelay(signer, desc, tx)
|
||||||
case CommitmentRevoke:
|
case CommitmentRevoke:
|
||||||
return CommitSpendRevoke(signer, desc, tx)
|
return CommitSpendRevoke(signer, desc, tx)
|
||||||
|
case HtlcOfferedRevoke:
|
||||||
|
return ReceiverHtlcSpendRevoke(signer, desc, tx)
|
||||||
|
case HtlcAcceptedRevoke:
|
||||||
|
return SenderHtlcSpendRevoke(signer, desc, tx)
|
||||||
default:
|
default:
|
||||||
return nil, fmt.Errorf("unknown witness type: %v", wt)
|
return nil, fmt.Errorf("unknown witness type: %v", wt)
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user