From 82fd4293e2a869b1b83e1f8cfac808eec0276e8b Mon Sep 17 00:00:00 2001 From: Hendrik Hofstadt Date: Tue, 19 Jan 2021 16:44:48 +0100 Subject: [PATCH] Fix guardian set expiration on Solana (#155) * fix guardian set expiration on Solana --- solana/bridge/src/processor.rs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/solana/bridge/src/processor.rs b/solana/bridge/src/processor.rs index a9586f55..b87b1666 100644 --- a/solana/bridge/src/processor.rs +++ b/solana/bridge/src/processor.rs @@ -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() {