@@ -4028,16 +4028,20 @@ func (lc *LightningChannel) createCommitDiff(newCommit *commitment,
40284028 if err != nil {
40294029 return nil , fmt .Errorf ("error packing aux sigs: %w" , err )
40304030 }
4031+ auxBlobRecords , err := lnwire .ParseCustomRecords (auxSigBlob )
4032+ if err != nil {
4033+ return nil , fmt .Errorf ("error parsing aux sigs: %w" , err )
4034+ }
40314035
40324036 return & channeldb.CommitDiff {
40334037 Commitment : * diskCommit ,
40344038 CommitSig : & lnwire.CommitSig {
40354039 ChanID : lnwire .NewChanIDFromOutPoint (
40364040 lc .channelState .FundingOutpoint ,
40374041 ),
4038- CommitSig : commitSig ,
4039- HtlcSigs : htlcSigs ,
4040- ExtraData : auxSigBlob ,
4042+ CommitSig : commitSig ,
4043+ HtlcSigs : htlcSigs ,
4044+ CustomRecords : auxBlobRecords ,
40414045 },
40424046 LogUpdates : logUpdates ,
40434047 OpenedCircuitKeys : openCircuitKeys ,
@@ -4737,12 +4741,18 @@ func (lc *LightningChannel) SignNextCommitment() (*NewCommitState, error) {
47374741 // latest commitment update.
47384742 lc .remoteCommitChain .addCommitment (newCommitView )
47394743
4744+ auxSigBlob , err := commitDiff .CommitSig .CustomRecords .Serialize ()
4745+ if err != nil {
4746+ return nil , fmt .Errorf ("unable to serialize aux sig " +
4747+ "blob: %v" , err )
4748+ }
4749+
47404750 return & NewCommitState {
47414751 CommitSigs : & CommitSigs {
47424752 CommitSig : sig ,
47434753 HtlcSigs : htlcSigs ,
47444754 PartialSig : lnwire .MaybePartialSigWithNonce (partialSig ),
4745- AuxSigBlob : commitDiff . CommitSig . ExtraData ,
4755+ AuxSigBlob : auxSigBlob ,
47464756 },
47474757 PendingHTLCs : commitDiff .Commitment .Htlcs ,
47484758 }, nil
@@ -4960,14 +4970,23 @@ func (lc *LightningChannel) ProcessChanSyncMsg(
49604970 // If we signed this state, then we'll accumulate
49614971 // another update to send over.
49624972 case err == nil :
4973+ blobRecords , err := lnwire .ParseCustomRecords (
4974+ newCommit .AuxSigBlob ,
4975+ )
4976+ if err != nil {
4977+ sErr := fmt .Errorf ("error parsing " +
4978+ "aux sigs: %w" , err )
4979+ return nil , nil , nil , sErr
4980+ }
4981+
49634982 commitSig := & lnwire.CommitSig {
49644983 ChanID : lnwire .NewChanIDFromOutPoint (
49654984 lc .channelState .FundingOutpoint ,
49664985 ),
4967- CommitSig : newCommit .CommitSig ,
4968- HtlcSigs : newCommit .HtlcSigs ,
4969- PartialSig : newCommit .PartialSig ,
4970- ExtraData : newCommit . AuxSigBlob ,
4986+ CommitSig : newCommit .CommitSig ,
4987+ HtlcSigs : newCommit .HtlcSigs ,
4988+ PartialSig : newCommit .PartialSig ,
4989+ CustomRecords : blobRecords ,
49714990 }
49724991
49734992 updates = append (updates , commitSig )
0 commit comments