reversing part of the transaction cull

This commit is contained in:
Roland Shoemaker 2015-05-06 21:48:37 -07:00
parent 1cc1df2726
commit 6a065d5cfc
1 changed files with 14 additions and 2 deletions

View File

@ -498,12 +498,24 @@ func (ssa *SQLStorageAuthority) FinalizeAuthorization(authz core.Authorization)
}
oldAuth := authObj.(*PendingAuthzModel)
err = ssa.dbMap.Insert(auth)
tx, err := ssa.dbMap.Begin()
if err != nil {
return
}
_, err = ssa.dbMap.Delete(oldAuth)
err = tx.Insert(auth)
if err != nil {
tx.Rollback()
return
}
_, err = tx.Delete(oldAuth)
if err != nil {
tx.Rollback()
return
}
tx.Commit()
return
}