ESP32: NTP для update user_pda

This commit is contained in:
AidarKC
2026-06-23 18:32:32 +04:00
parent 4b94303d67
commit 7d9db68d80
3 changed files with 14 additions and 4 deletions
@@ -3254,6 +3254,16 @@ static bool updateHomeserverSessionOnSolana(bool requireExisting, String &messag
}
saveRegisterDiagCheckpoint("Local keys restored", diagDetails);
if (!ensureNtpTimeSynced(messageOut)) {
diagDetails += String("ntp_error=") + messageOut + "\n";
return failWithDiag(messageOut);
}
uint64_t updatedAtMs = 0;
if (!getSystemEpochMs(updatedAtMs)) {
return failWithDiag("NTP time is not ready");
}
diagDetails += String("updated_at_ms=") + String((unsigned long long)updatedAtMs) + "\n";
uint8_t userPda[32] = {};
uint8_t economyConfig[32] = {};
uint8_t inflowVault[32] = {};
@@ -3279,7 +3289,7 @@ static bool updateHomeserverSessionOnSolana(bool requireExisting, String &messag
memcpy(nextState.recoveryKey32, recoveryPub, 32);
memcpy(nextState.rootKey32, rootPub, 32);
memcpy(nextState.clientKey32, clientPub, 32);
nextState.updatedAtMs = shineNowMs();
nextState.updatedAtMs = updatedAtMs;
nextState.recordNumber = currentState.recordNumber + 1;
if (nextState.sessionsMode == 0) {
nextState.sessionsMode = 1;