@@ -3321,6 +3321,81 @@ impl Deserializer for VirtualDaaScoreChangedNotification {
3321
3321
}
3322
3322
}
3323
3323
3324
+ // NotifyMempoolSizeChangedRequest registers this connection for
3325
+ // mempoolSizeChanged notifications.
3326
+ //
3327
+ // See: MempoolSizeChangedNotification
3328
+ #[ derive( Clone , Debug , Serialize , Deserialize ) ]
3329
+ #[ serde( rename_all = "camelCase" ) ]
3330
+ pub struct NotifyMempoolSizeChangedRequest {
3331
+ pub command : Command ,
3332
+ }
3333
+
3334
+ impl NotifyMempoolSizeChangedRequest {
3335
+ pub fn new ( command : Command ) -> Self {
3336
+ Self { command }
3337
+ }
3338
+ }
3339
+
3340
+ impl Serializer for NotifyMempoolSizeChangedRequest {
3341
+ fn serialize < W : std:: io:: Write > ( & self , writer : & mut W ) -> std:: io:: Result < ( ) > {
3342
+ store ! ( u16 , & 1 , writer) ?;
3343
+ store ! ( Command , & self . command, writer) ?;
3344
+ Ok ( ( ) )
3345
+ }
3346
+ }
3347
+
3348
+ impl Deserializer for NotifyMempoolSizeChangedRequest {
3349
+ fn deserialize < R : std:: io:: Read > ( reader : & mut R ) -> std:: io:: Result < Self > {
3350
+ let _version = load ! ( u16 , reader) ?;
3351
+ let command = load ! ( Command , reader) ?;
3352
+ Ok ( Self { command } )
3353
+ }
3354
+ }
3355
+
3356
+ #[ derive( Clone , Debug , Serialize , Deserialize ) ]
3357
+ #[ serde( rename_all = "camelCase" ) ]
3358
+ pub struct NotifyMempoolSizeChangedResponse { }
3359
+
3360
+ impl Serializer for NotifyMempoolSizeChangedResponse {
3361
+ fn serialize < W : std:: io:: Write > ( & self , writer : & mut W ) -> std:: io:: Result < ( ) > {
3362
+ store ! ( u16 , & 1 , writer) ?;
3363
+ Ok ( ( ) )
3364
+ }
3365
+ }
3366
+
3367
+ impl Deserializer for NotifyMempoolSizeChangedResponse {
3368
+ fn deserialize < R : std:: io:: Read > ( reader : & mut R ) -> std:: io:: Result < Self > {
3369
+ let _version = load ! ( u16 , reader) ?;
3370
+ Ok ( Self { } )
3371
+ }
3372
+ }
3373
+
3374
+ // MempoolSizeChangedNotification is sent whenever the mempool changes.
3375
+ //
3376
+ // See NotifyMempoolSizeChangedRequest
3377
+ #[ derive( Clone , Debug , Serialize , Deserialize ) ]
3378
+ #[ serde( rename_all = "camelCase" ) ]
3379
+ pub struct MempoolSizeChangedNotification {
3380
+ pub network_mempool_size : u64 ,
3381
+ }
3382
+
3383
+ impl Serializer for MempoolSizeChangedNotification {
3384
+ fn serialize < W : std:: io:: Write > ( & self , writer : & mut W ) -> std:: io:: Result < ( ) > {
3385
+ store ! ( u16 , & 1 , writer) ?;
3386
+ store ! ( u64 , & self . network_mempool_size, writer) ?;
3387
+ Ok ( ( ) )
3388
+ }
3389
+ }
3390
+
3391
+ impl Deserializer for MempoolSizeChangedNotification {
3392
+ fn deserialize < R : std:: io:: Read > ( reader : & mut R ) -> std:: io:: Result < Self > {
3393
+ let _version = load ! ( u16 , reader) ?;
3394
+ let network_mempool_size = load ! ( u64 , reader) ?;
3395
+ Ok ( Self { network_mempool_size } )
3396
+ }
3397
+ }
3398
+
3324
3399
// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
3325
3400
// PruningPointUtxoSetOverrideNotification
3326
3401
0 commit comments