File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -15,6 +15,16 @@ pub(crate) async fn handle(
1515 return Err ( WsError :: InvalidParams ) ;
1616 }
1717
18+ let max_filters = context. state . mint . max_inputs ( ) ;
19+ if params. filters . len ( ) > max_filters {
20+ tracing:: warn!(
21+ "WebSocket subscription request exceeds max filters limit: {} > {}" ,
22+ params. filters. len( ) ,
23+ max_filters
24+ ) ;
25+ return Err ( WsError :: InvalidParams ) ;
26+ }
27+
1828 let mut subscription = context
1929 . state
2030 . mint
Original file line number Diff line number Diff line change @@ -475,11 +475,19 @@ impl Mint {
475475 }
476476
477477 /// Localstore
478+ #[ inline]
478479 pub fn localstore ( & self ) -> DynMintDatabase {
479480 Arc :: clone ( & self . localstore )
480481 }
481482
483+ /// Get the maximum number of inputs allowed per transaction
484+ #[ inline]
485+ pub fn max_inputs ( & self ) -> usize {
486+ self . max_inputs
487+ }
488+
482489 /// Pub Sub manager
490+ #[ inline]
483491 pub fn pubsub_manager ( & self ) -> Arc < PubSubManager > {
484492 Arc :: clone ( & self . pubsub_manager )
485493 }
You can’t perform that action at this time.
0 commit comments