if (index >= addrs.len()) && (addrs.len() != MAX_ETH_LINKS) {
addrs.push(addr.clone());
} else if (index >= addrs.len()) && (addrs.len() == MAX_ETH_LINKS) {
addrs[MAX_ETH_LINKS - 1] = addr.clone();
} else {
addrs[index] = addr.clone();
}
Currently we use the following code the insert a new address for eth (and also btc).
1 This may be extracted as a function
2 != is suspicious (also the whole logic)