mirror of
https://github.com/hl-archive-node/nanoreth.git
synced 2025-12-06 19:09:54 +00:00
feat(rpc) : support for eth_newPendingTransactionFilter full rpc function (#5206)
Co-authored-by: Matthias Seitz <matthias.seitz@outlook.de>
This commit is contained in:
committed by
GitHub
parent
64d50643c8
commit
ed9b9a7d82
@ -1113,6 +1113,22 @@ impl<Tx: PoolTransaction> NewSubpoolTransactionStream<Tx> {
|
||||
pub fn new(st: Receiver<NewTransactionEvent<Tx>>, subpool: SubPool) -> Self {
|
||||
Self { st, subpool }
|
||||
}
|
||||
|
||||
/// Tries to receive the next value for this stream.
|
||||
pub fn try_recv(
|
||||
&mut self,
|
||||
) -> Result<NewTransactionEvent<Tx>, tokio::sync::mpsc::error::TryRecvError> {
|
||||
loop {
|
||||
match self.st.try_recv() {
|
||||
Ok(event) => {
|
||||
if event.subpool == self.subpool {
|
||||
return Ok(event)
|
||||
}
|
||||
}
|
||||
Err(e) => return Err(e),
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
impl<Tx: PoolTransaction> Stream for NewSubpoolTransactionStream<Tx> {
|
||||
|
||||
Reference in New Issue
Block a user