Skip to content
Snippets Groups Projects
Commit 57bb2d40 authored by Richard T. Carback III's avatar Richard T. Carback III
Browse files

Fix rare edge case on failed confirmation sends

parent 592a8e0d
No related branches found
No related tags found
3 merge requests!233Modify restore to call user-defined bindings callback. Add Sent requests to...,!231Revert "Update store to print changes to the partners list",!192Hotfix/improved restore
......@@ -348,7 +348,7 @@ func (m *Manager) handleRequest(cmixMsg format.Message,
var rndNum id.Round
if autoConfirm || resetSession {
// Call ConfirmRequestAuth to send confirmation
rndNum, err = m.ConfirmRequestAuth(c)
rndNum, err = m.confirmRequestAuth(c, true)
if err != nil {
jww.ERROR.Printf("Could not ConfirmRequestAuth: %+v",
err)
......
......@@ -32,6 +32,11 @@ func (m *Manager) ConfirmRequestAuth(partner contact.Contact) (id.Round, error)
return 0, errors.New("Cannot confirm authenticated message " +
"when the network is not healthy")
}
return m.confirmRequestAuth(partner, false)
}
func (m *Manager) confirmRequestAuth(partner contact.Contact, critical bool) (id.Round,
error) {
// Cannot confirm already established channels
if _, err := m.storage.E2e().GetPartner(partner.ID); err == nil {
......@@ -156,15 +161,28 @@ func (m *Manager) ConfirmRequestAuth(partner contact.Contact) (id.Round, error)
param.IdentityPreimage = preimg
param.DebugTag = "auth.Confirm"
/*send message*/
if critical {
m.storage.GetCriticalRawMessages().AddProcessing(cmixMsg,
partner.ID)
}
round, _, err := m.net.SendCMIX(cmixMsg, partner.ID, param)
if err != nil {
// if the send fails just set it to failed, it will but automatically
// retried
jww.INFO.Printf("Auth Confirm with %s (msgDigest: %s) failed "+
"to transmit: %+v", partner.ID, cmixMsg.Digest(), err)
if critical {
m.storage.GetCriticalRawMessages().Failed(cmixMsg,
partner.ID)
}
return 0, errors.WithMessage(err, "Auth Confirm Failed to transmit")
}
if critical {
m.storage.GetCriticalRawMessages().Succeeded(cmixMsg,
partner.ID)
}
em := fmt.Sprintf("Confirm Request with %s (msgDigest: %s) sent on round %d",
partner.ID, cmixMsg.Digest(), round)
jww.INFO.Print(em)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment