- Notifications
You must be signed in to change notification settings - Fork 216
TC_068_CS / Stop transaction logic simplication#433
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base:main
Are you sure you want to change the base?
Uh oh!
There was an error while loading. Please reload this page.
Changes from all commits
File filter
Filter by extension
Conversations
Uh oh!
There was an error while loading. Please reload this page.
Jump to
Uh oh!
There was an error while loading. Please reload this page.
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -547,7 +547,7 @@ bool endTransaction(const char *idTag, const char *reason, unsigned int connecto | ||
| } | ||
| return; | ||
| } | ||
| if (idTagInfo.containsKey("parentIdTag") && !strcmp(idTagInfo["parenIdTag"], tx->getParentIdTag())) | ||
| if (idTagInfo.containsKey("parentIdTag") && !strcmp(idTagInfo["parentIdTag"], tx->getParentIdTag())) | ||
| { | ||
| endTransaction_authorized(idTag_capture.c_str(), reason_capture.empty() ? (const char*)nullptr : reason_capture.c_str(), connectorId); | ||
| } | ||
| @@ -1397,6 +1397,18 @@ void authorize(const char *idTag, OnReceiveConfListener onConf, OnAbortListener | ||
| MO_DBG_ERR("idTag format violation. Expect c-style string with at most %u characters", IDTAG_LEN_MAX); | ||
| return; | ||
| } | ||
| //check for active transactions | ||
| for (unsigned int cId = 1; cId < context->getModel().getNumConnectors(); cId++) { | ||
| if (isTransactionActive(cId)) { | ||
| //this will check both parentIdTag and idTag | ||
| if (endTransaction(idTag, "Local", cId)) { | ||
| MO_DBG_INFO("ended active transaction on connector %d for idTag '%s'", cId, idTag); | ||
| ||
| return; | ||
| } | ||
| } | ||
| } | ||
| auto authorize = makeRequest( | ||
| new Authorize(context->getModel(), idTag)); | ||
| if (onConf) | ||
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
to be honest, this is not really needed, as it's checked again in
endTransaction()...