rpc: fix possible panics in optimize_filters (#29146)
This commit is contained in:
parent
1e0a0e0ced
commit
ccd96e246b
|
@ -2225,10 +2225,14 @@ fn optimize_filters(filters: &mut [RpcFilterType]) {
|
||||||
match &compare.bytes {
|
match &compare.bytes {
|
||||||
#[allow(deprecated)]
|
#[allow(deprecated)]
|
||||||
Binary(bytes) | Base58(bytes) => {
|
Binary(bytes) | Base58(bytes) => {
|
||||||
compare.bytes = Bytes(bs58::decode(bytes).into_vec().unwrap());
|
if let Ok(bytes) = bs58::decode(bytes).into_vec() {
|
||||||
|
compare.bytes = Bytes(bytes);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
Base64(bytes) => {
|
Base64(bytes) => {
|
||||||
compare.bytes = Bytes(base64::decode(bytes).unwrap());
|
if let Ok(bytes) = base64::decode(bytes) {
|
||||||
|
compare.bytes = Bytes(bytes);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
_ => {}
|
_ => {}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue