bridge: prevent multiple signatures from single guardian

This commit is contained in:
Hendrik Hofstadt 2020-08-31 09:26:38 +02:00
parent b4b0c61dfc
commit 45a25e0386
1 changed files with 7 additions and 0 deletions

View File

@ -61,7 +61,14 @@ impl VAA {
return false; return false;
} }
let mut last_index: i16 = -1;
for sig in self.signatures.iter() { for sig in self.signatures.iter() {
// Prevent multiple sinatures by the same guardian
if sig.index as i16 <= last_index {
return false;
}
last_index = sig.index as i16;
let ecrecover_input = EcrecoverInput::new(sig.r, sig.s, sig.v, hash); let ecrecover_input = EcrecoverInput::new(sig.r, sig.s, sig.v, hash);
let res = match sol_syscall_ecrecover(&ecrecover_input) { let res = match sol_syscall_ecrecover(&ecrecover_input) {
Ok(v) => v, Ok(v) => v,