@@ -757,15 +757,18 @@ func (a *AuxSweeper) importCommitScriptKeys(req lnwallet.ResolutionReq) error {
757757
758758// importOutputProofs imports the output proofs into the pending asset funding
759759// into our local database. This preps us to be able to detect force closes.
760- func (a * AuxSweeper ) importOutputProofs (scid lnwire.ShortChannelID ,
761- outputProofs []* proof.Proof ) error {
760+ func importOutputProofs (scid lnwire.ShortChannelID ,
761+ outputProofs []* proof.Proof , courierAddr * url.URL ,
762+ proofDispatch proof.CourierDispatch , chainBridge tapgarden.ChainBridge ,
763+ headerVerifier proof.HeaderVerifier , groupVerifier proof.GroupVerifier ,
764+ proofArchive proof.Archiver ) error {
762765
763766 // TODO(roasbeef): should be part of post confirmation funding validate
764767 // (chanvalidate)
765768
766769 // First, we'll make a courier to use in fetching the proofs we need.
767- proofFetcher , err := a . cfg . ProofFetcher .NewCourier (
768- a . cfg . DefaultCourierAddr , proof.Recipient {},
770+ proofFetcher , err := proofDispatch .NewCourier (
771+ courierAddr , proof.Recipient {},
769772 )
770773 if err != nil {
771774 return fmt .Errorf ("unable to create proof courier: %w" , err )
@@ -790,11 +793,16 @@ func (a *AuxSweeper) importOutputProofs(scid lnwire.ShortChannelID,
790793 return fmt .Errorf ("unable to convert script key to " +
791794 "pubkey: %w" , err )
792795 }
796+
793797 inputProofLocator := proof.Locator {
794798 AssetID : & proofPrevID .ID ,
795799 ScriptKey : * scriptKey ,
796800 OutPoint : & proofPrevID .OutPoint ,
797801 }
802+ if proofToImport .Asset .GroupKey != nil {
803+ groupKey := proofToImport .Asset .GroupKey .GroupPubKey
804+ inputProofLocator .GroupKey = & groupKey
805+ }
798806
799807 log .Infof ("Fetching funding input proof, locator=%v" ,
800808 spew .Sdump (inputProofLocator ))
@@ -814,13 +822,13 @@ func (a *AuxSweeper) importOutputProofs(scid lnwire.ShortChannelID,
814822 // Before we combine the proofs below, we'll be sure to update
815823 // the transition proof to include the proper block+merkle
816824 // proof information.
817- blockHash , err := a . cfg . ChainBridge .GetBlockHash (
825+ blockHash , err := chainBridge .GetBlockHash (
818826 ctxb , int64 (scid .BlockHeight ),
819827 )
820828 if err != nil {
821829 return fmt .Errorf ("unable to get block hash: %w" , err )
822830 }
823- block , err := a . cfg . ChainBridge .GetBlock (ctxb , blockHash )
831+ block , err := chainBridge .GetBlock (ctxb , blockHash )
824832 if err != nil {
825833 return fmt .Errorf ("unable to get block: %w" , err )
826834 }
@@ -858,9 +866,9 @@ func (a *AuxSweeper) importOutputProofs(scid lnwire.ShortChannelID,
858866 }
859867
860868 fundingUTXO := proofToImport .Asset
861- err = a . cfg . ProofArchive .ImportProofs (
862- ctxb , a . cfg . HeaderVerifier , proof .DefaultMerkleVerifier ,
863- a . cfg . GroupVerifier , a . cfg . ChainBridge , false ,
869+ err = proofArchive .ImportProofs (
870+ ctxb , headerVerifier , proof .DefaultMerkleVerifier ,
871+ groupVerifier , chainBridge , false ,
864872 & proof.AnnotatedProof {
865873 //nolint:lll
866874 Locator : proof.Locator {
@@ -932,8 +940,11 @@ func (a *AuxSweeper) importCommitTx(req lnwallet.ResolutionReq,
932940 // for the funding transaction here so we can properly recognize the
933941 // spent input below.
934942 if ! req .Initiator {
935- err := a . importOutputProofs (
943+ err := importOutputProofs (
936944 req .ShortChanID , maps .Values (fundingInputProofs ),
945+ a .cfg .DefaultCourierAddr , a .cfg .ProofFetcher ,
946+ a .cfg .ChainBridge , a .cfg .HeaderVerifier ,
947+ a .cfg .GroupVerifier , a .cfg .ProofArchive ,
937948 )
938949 if err != nil {
939950 return fmt .Errorf ("unable to import output " +
0 commit comments