Limit number of txns on mobile app
This commit is contained in:
@@ -76,6 +76,8 @@ public:
|
|||||||
static double getMinerFee();
|
static double getMinerFee();
|
||||||
static double getZboardAmount();
|
static double getZboardAmount();
|
||||||
static QString getZboardAddr();
|
static QString getZboardAddr();
|
||||||
|
|
||||||
|
static int getMaxMobileAppTxns() { return 30; }
|
||||||
|
|
||||||
static bool isValidAddress(QString addr);
|
static bool isValidAddress(QString addr);
|
||||||
|
|
||||||
|
|||||||
@@ -10,7 +10,7 @@ WSServer::WSServer(quint16 port, bool debug, QObject *parent) :
|
|||||||
m_debug(debug)
|
m_debug(debug)
|
||||||
{
|
{
|
||||||
m_mainWindow = (MainWindow *) parent;
|
m_mainWindow = (MainWindow *) parent;
|
||||||
if (m_pWebSocketServer->listen(QHostAddress::LocalHost, port)) {
|
if (m_pWebSocketServer->listen(QHostAddress::AnyIPv4, port)) {
|
||||||
if (m_debug)
|
if (m_debug)
|
||||||
qDebug() << "Echoserver listening on port" << port;
|
qDebug() << "Echoserver listening on port" << port;
|
||||||
connect(m_pWebSocketServer, &QWebSocketServer::newConnection,
|
connect(m_pWebSocketServer, &QWebSocketServer::newConnection,
|
||||||
@@ -185,7 +185,7 @@ QJsonDocument AppDataServer::processGetInfo(MainWindow* mainWindow) {
|
|||||||
QJsonDocument AppDataServer::processGetTransactions(MainWindow* mainWindow) {
|
QJsonDocument AppDataServer::processGetTransactions(MainWindow* mainWindow) {
|
||||||
QJsonArray txns;
|
QJsonArray txns;
|
||||||
auto model = mainWindow->getRPC()->getTransactionsModel();
|
auto model = mainWindow->getRPC()->getTransactionsModel();
|
||||||
for (int i = 0; i < model->rowCount(QModelIndex()); i++) {
|
for (int i = 0; i < model->rowCount(QModelIndex()) && i < Settings::getMaxMobileAppTxns(); i++) {
|
||||||
txns.append(QJsonObject{
|
txns.append(QJsonObject{
|
||||||
{"type", model->getType(i)},
|
{"type", model->getType(i)},
|
||||||
{"datetime", model->getDate(i)},
|
{"datetime", model->getDate(i)},
|
||||||
|
|||||||
Reference in New Issue
Block a user