mirror of
https://github.com/overte-org/overte.git
synced 2025-04-20 11:45:36 +02:00
stub sending of transactions to server
This commit is contained in:
parent
5b3b19011e
commit
ee67c64b76
3 changed files with 22 additions and 4 deletions
|
@ -59,11 +59,17 @@ DomainServer::DomainServer(int argc, char* argv[]) :
|
|||
_networkAccessManager = new QNetworkAccessManager(this);
|
||||
|
||||
// setup a timer to send transactions to pay assigned nodes every 30 seconds
|
||||
QTimer* nodePaymentTimer = new QTimer(this);
|
||||
connect(nodePaymentTimer, &QTimer::timeout, this, &DomainServer::setupPendingAssignmentCredits);
|
||||
QTimer* creditSetupTimer = new QTimer(this);
|
||||
connect(creditSetupTimer, &QTimer::timeout, this, &DomainServer::setupPendingAssignmentCredits);
|
||||
|
||||
const qint64 CREDIT_CHECK_INTERVAL = 5 * 1000;
|
||||
nodePaymentTimer->start(CREDIT_CHECK_INTERVAL);
|
||||
const qint64 CREDIT_CHECK_INTERVAL_MSECS = 5 * 1000;
|
||||
creditSetupTimer->start(CREDIT_CHECK_INTERVAL_MSECS);
|
||||
|
||||
QTimer* nodePaymentTimer = new QTimer(this);
|
||||
connect(nodePaymentTimer, &QTimer::timeout, this, &DomainServer::sendPendingTransactionsToServer);
|
||||
|
||||
const qint64 TRANSACTION_SEND_INTERVAL_MSECS = 30 * 1000;
|
||||
nodePaymentTimer->start(TRANSACTION_SEND_INTERVAL_MSECS);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -694,6 +700,16 @@ void DomainServer::setupPendingAssignmentCredits() {
|
|||
}
|
||||
}
|
||||
|
||||
void DomainServer::sendPendingTransactionsToServer() {
|
||||
// enumerate the pending transactions and send them to the server to complete payment
|
||||
TransactionHash::iterator i = _pendingAssignmentCredits.begin();
|
||||
|
||||
while (i != _pendingAssignmentCredits.end()) {
|
||||
|
||||
++i;
|
||||
}
|
||||
}
|
||||
|
||||
void DomainServer::processDatagram(const QByteArray& receivedPacket, const HifiSockAddr& senderSockAddr) {
|
||||
LimitedNodeList* nodeList = LimitedNodeList::getInstance();
|
||||
|
||||
|
|
|
@ -50,6 +50,7 @@ public slots:
|
|||
private slots:
|
||||
void readAvailableDatagrams();
|
||||
void setupPendingAssignmentCredits();
|
||||
void sendPendingTransactionsToServer();
|
||||
private:
|
||||
void setupNodeListAndAssignments(const QUuid& sessionUUID = QUuid::createUuid());
|
||||
bool optionallySetupOAuth();
|
||||
|
|
|
@ -30,6 +30,7 @@ public:
|
|||
void incrementAmount(double increment) { _amount += increment; }
|
||||
|
||||
bool isFinalized() const { return _isFinalized; }
|
||||
void setIsFinalized(bool isFinalized) { _isFinalized = isFinalized; }
|
||||
|
||||
QJsonDocument postJson();
|
||||
private:
|
||||
|
|
Loading…
Reference in a new issue