Fix guardian set expiration on Solana (#155)

* fix guardian set expiration on Solana
This commit is contained in:
Hendrik Hofstadt 2021-01-19 16:44:48 +01:00 committed by GitHub
parent 9f2f609bc1
commit 82fd4293e2
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 3 additions and 1 deletions

View File

@ -699,7 +699,7 @@ impl Bridge {
}
// Check that the guardian set is still active
if (guardian_set.expiration_time as i64) > clock.unix_timestamp {
if guardian_set.expiration_time != 0 && (guardian_set.expiration_time as i64) < clock.unix_timestamp {
return Err(Error::GuardianSetExpired.into());
}
@ -885,6 +885,8 @@ impl Bridge {
// Set values on the new guardian set
guardian_set_new.is_initialized = true;
// Force the new guardian set to not expire
guardian_set_new.expiration_time = 0;
guardian_set_new.index = b.new_index;
let mut new_guardians = [[0u8; 20]; MAX_LEN_GUARDIAN_KEYS];
for n in 0..b.new_keys.len() {