fix race condition in Postgres backend. add cursor to account_tx response. test script verifies account_tx

This commit is contained in:
CJ Cobb
2021-03-11 13:14:21 -05:00
parent b340f24e2c
commit d62f7accfe
4 changed files with 115 additions and 56 deletions

View File

@@ -209,7 +209,13 @@ doAccountTx(boost::json::object const& request, BackendInterface const& backend)
txns.push_back(obj);
}
response["transactions"] = txns;
response["cursor"] = {};
if (retCursor)
{
boost::json::object cursorJson;
cursorJson["ledger_sequence"] = retCursor->ledgerSequence;
cursorJson["transaction_index"] = retCursor->transactionIndex;
response["cursor"] = cursorJson;
}
return response;
}