File tree Expand file tree Collapse file tree 1 file changed +16
-0
lines changed Expand file tree Collapse file tree 1 file changed +16
-0
lines changed Original file line number Diff line number Diff line change @@ -10,6 +10,8 @@ import (
1010 "github.com/btcsuite/btcd/wire"
1111 "github.com/lightninglabs/loop/fsm"
1212 "github.com/lightninglabs/loop/staticaddr/address"
13+ "github.com/lightninglabs/loop/staticaddr/script"
14+ "github.com/lightningnetwork/lnd/input"
1315 "github.com/lightningnetwork/lnd/lntypes"
1416)
1517
@@ -118,6 +120,20 @@ func (d *Deposit) IsInStateNoLock(state fsm.StateType) bool {
118120 return d .state == state
119121}
120122
123+ // GetStaticAddressScript returns the static address script of the deposit.
124+ func (d * Deposit ) GetStaticAddressScript () (* script.StaticAddress , error ) {
125+ params := d .AddressParams
126+ address , err := script .NewStaticAddress (
127+ input .MuSig2Version100RC2 , int64 (params .Expiry ),
128+ params .ClientPubkey , params .ServerPubkey ,
129+ )
130+ if err != nil {
131+ return nil , err
132+ }
133+
134+ return address , nil
135+ }
136+
121137// GetRandomDepositID generates a random deposit ID.
122138func GetRandomDepositID () (ID , error ) {
123139 var id ID
You can’t perform that action at this time.
0 commit comments