loopin: use context.WithoutCancel in cleanup

Ensure that MuSig2 cleanup does happen even if a context expires.
This commit is contained in:
Boris Nagaev 2025-03-16 18:21:32 -03:00
parent db090960b2
commit c2dddf0dfe
No known key found for this signature in database
2 changed files with 5 additions and 2 deletions

View file

@ -418,7 +418,9 @@ func (f *FSM) cleanUpSessions(ctx context.Context,
sessions []*input.MuSig2SessionInfo) {
for _, s := range sessions {
err := f.cfg.Signer.MuSig2Cleanup(ctx, s.SessionID)
err := f.cfg.Signer.MuSig2Cleanup(
context.WithoutCancel(ctx), s.SessionID,
)
if err != nil {
f.Warnf("unable to cleanup musig2 session: %v", err)
}

View file

@ -360,7 +360,8 @@ func (m *Manager) handleLoopInSweepReq(ctx context.Context,
// We'll clean up the session if we don't get to signing.
defer func() {
err = m.cfg.Signer.MuSig2Cleanup(
ctx, musig2Session.SessionID,
context.WithoutCancel(ctx),
musig2Session.SessionID,
)
if err != nil {
log.Errorf("Error cleaning up musig2 session: "+