@@ -30,21 +30,27 @@ impl BlockFilter {
3030 Self { shared }
3131 }
3232
33- fn try_process (
33+ async fn try_process (
3434 & mut self ,
3535 nc : Arc < dyn CKBProtocolContext + Sync > ,
3636 peer : PeerIndex ,
3737 message : packed:: BlockFilterMessageUnionReader < ' _ > ,
3838 ) -> Status {
3939 match message {
4040 packed:: BlockFilterMessageUnionReader :: GetBlockFilters ( msg) => {
41- GetBlockFiltersProcess :: new ( msg, self , nc, peer) . execute ( )
41+ GetBlockFiltersProcess :: new ( msg, self , nc, peer)
42+ . execute ( )
43+ . await
4244 }
4345 packed:: BlockFilterMessageUnionReader :: GetBlockFilterHashes ( msg) => {
44- GetBlockFilterHashesProcess :: new ( msg, self , nc, peer) . execute ( )
46+ GetBlockFilterHashesProcess :: new ( msg, self , nc, peer)
47+ . execute ( )
48+ . await
4549 }
4650 packed:: BlockFilterMessageUnionReader :: GetBlockFilterCheckPoints ( msg) => {
47- GetBlockFilterCheckPointsProcess :: new ( msg, self , nc, peer) . execute ( )
51+ GetBlockFilterCheckPointsProcess :: new ( msg, self , nc, peer)
52+ . execute ( )
53+ . await
4854 }
4955 packed:: BlockFilterMessageUnionReader :: BlockFilters ( _)
5056 | packed:: BlockFilterMessageUnionReader :: BlockFilterHashes ( _)
@@ -61,15 +67,15 @@ impl BlockFilter {
6167 }
6268 }
6369
64- fn process (
70+ async fn process (
6571 & mut self ,
6672 nc : Arc < dyn CKBProtocolContext + Sync > ,
6773 peer : PeerIndex ,
6874 message : packed:: BlockFilterMessageUnionReader < ' _ > ,
6975 ) {
7076 let item_name = message. item_name ( ) ;
7177 let item_bytes = message. as_slice ( ) . len ( ) as u64 ;
72- let status = self . try_process ( Arc :: clone ( & nc) , peer, message) ;
78+ let status = self . try_process ( Arc :: clone ( & nc) , peer, message) . await ;
7379
7480 metric_ckb_message_bytes (
7581 MetricDirection :: In ,
@@ -143,7 +149,7 @@ impl CKBProtocolHandler for BlockFilter {
143149 peer_index
144150 ) ;
145151 let start_time = Instant :: now ( ) ;
146- self . process ( nc, peer_index, msg) ;
152+ self . process ( nc, peer_index, msg) . await ;
147153 debug_target ! (
148154 crate :: LOG_TARGET_FILTER ,
149155 "process message={}, peer={}, cost={:?}" ,
0 commit comments