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
@@ -117,6 +119,20 @@ func (d *Deposit) IsInStateNoLock(state fsm.StateType) bool {
117119 return d .state == state
118120}
119121
122+ // GetStaticAddressScript returns the static address script of the deposit.
123+ func (d * Deposit ) GetStaticAddressScript () (* script.StaticAddress , error ) {
124+ params := d .AddressParams
125+ address , err := script .NewStaticAddress (
126+ input .MuSig2Version100RC2 , int64 (params .Expiry ),
127+ params .ClientPubkey , params .ServerPubkey ,
128+ )
129+ if err != nil {
130+ return nil , err
131+ }
132+
133+ return address , nil
134+ }
135+
120136// GetRandomDepositID generates a random deposit ID.
121137func GetRandomDepositID () (ID , error ) {
122138 var id ID
You can’t perform that action at this time.
0 commit comments