SHA256
ESP32: NTP для update user_pda
This commit is contained in:
+11
-1
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user