Skip to content

Commit 4be9eb8

Browse files
committed
f - remove returnErr pattern - accounts: associate payments before sending them
1 parent ca6a8a7 commit 4be9eb8

File tree

1 file changed

+10
-8
lines changed

1 file changed

+10
-8
lines changed

accounts/service.go

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -579,15 +579,17 @@ func (s *InterceptorService) TrackPayment(id AccountID, hash lntypes.Hash,
579579
// track the service is restarted. Therefore the node
580580
// runner needs to manually check if the payment was
581581
// made and debit the account if that's the case.
582-
mainChanErr := fmt.Errorf("critical error: failed to "+
583-
"store the payment with hash %v for user with "+
584-
"account id %v. Manual intervention required! "+
585-
"Verify if the payment was executed, and "+
586-
"manually update the user account balance by "+
587-
"subtracting the payment amount if it was",
588-
hash, id,
582+
errStr := "critical error: failed to store the " +
583+
"payment with hash %v for user with account " +
584+
"id %v. Manual intervention required! " +
585+
"Verify if the payment was executed, and " +
586+
"manually update the user account balance by " +
587+
"subtracting the payment amount if it was"
588+
589+
mainChanErr := s.disableAndErrorfUnsafe(
590+
errStr, hash, id,
589591
)
590-
s.disableUnsafe()
592+
591593
s.mainErrCallback(mainChanErr)
592594
}
593595
}

0 commit comments

Comments
 (0)