swap: HTLCV3 added

In this commit we add the version 3 htlc, which is implemented with
taproot script spending the two payment paths: the claim path case, and
the timeout case.
This commit is contained in:
Harsha Goli 2022-04-14 12:40:30 -04:00
parent fd811a8ded
commit dec6dd7e70
No known key found for this signature in database
GPG key ID: 90E00CCB1C74C611
11 changed files with 733 additions and 67 deletions

View file

@ -195,7 +195,7 @@ func (s *Client) FetchSwaps() ([]*SwapInfo, error) {
htlc, err := swap.NewHtlc(
GetHtlcScriptVersion(swp.Contract.ProtocolVersion),
swp.Contract.CltvExpiry, swp.Contract.SenderKey,
swp.Contract.ReceiverKey, swp.Hash, swap.HtlcP2WSH,
swp.Contract.ReceiverKey, nil, swp.Hash, swap.HtlcP2WSH,
s.lndServices.ChainParams,
)
if err != nil {
@ -216,7 +216,7 @@ func (s *Client) FetchSwaps() ([]*SwapInfo, error) {
htlcNP2WSH, err := swap.NewHtlc(
GetHtlcScriptVersion(swp.Contract.ProtocolVersion),
swp.Contract.CltvExpiry, swp.Contract.SenderKey,
swp.Contract.ReceiverKey, swp.Hash, swap.HtlcNP2WSH,
swp.Contract.ReceiverKey, nil, swp.Hash, swap.HtlcNP2WSH,
s.lndServices.ChainParams,
)
if err != nil {
@ -226,7 +226,7 @@ func (s *Client) FetchSwaps() ([]*SwapInfo, error) {
htlcP2WSH, err := swap.NewHtlc(
GetHtlcScriptVersion(swp.Contract.ProtocolVersion),
swp.Contract.CltvExpiry, swp.Contract.SenderKey,
swp.Contract.ReceiverKey, swp.Hash, swap.HtlcP2WSH,
swp.Contract.ReceiverKey, nil, swp.Hash, swap.HtlcP2WSH,
s.lndServices.ChainParams,
)
if err != nil {