Add filter for deleted accounts

This commit is contained in:
godmodegalactus 2024-06-11 15:34:51 +02:00
parent 611fef8b1a
commit 450934d5cd
No known key found for this signature in database
GPG Key ID: 22DA4A30887FDA3C
1 changed files with 5 additions and 0 deletions

View File

@ -15,6 +15,7 @@ pub enum Filter {
Transaction(Signature),
TransactionsAll,
BlockAll,
DeletedAccounts,
}
impl Filter {
@ -35,6 +36,10 @@ impl Filter {
}
Filter::TransactionsAll => matches!(message, ChannelMessage::Transaction(_)),
Filter::BlockAll => matches!(message, ChannelMessage::Block(_)),
Filter::DeletedAccounts => match message {
ChannelMessage::Account(account, _) => account.account.lamports == 0,
_ => false,
},
}
}
}