mirror of
https://github.com/ElementsProject/lightning.git
synced 2024-11-19 01:43:36 +01:00
cln_plugin: custommessages in get_manifest
This commit is contained in:
parent
42a7b63d30
commit
71c343e2d1
@ -47,6 +47,7 @@ where
|
||||
rpcmethods: HashMap<String, RpcMethod<S>>,
|
||||
subscriptions: HashMap<String, Subscription<S>>,
|
||||
notifications: Vec<NotificationTopic>,
|
||||
custommessages : Vec<u16>,
|
||||
dynamic: bool,
|
||||
// Do we want the plugin framework to automatically register a logging handler?
|
||||
logging: bool,
|
||||
@ -122,6 +123,7 @@ where
|
||||
rpcmethods: HashMap::new(),
|
||||
notifications: vec![],
|
||||
dynamic: false,
|
||||
custommessages : vec![],
|
||||
logging: true,
|
||||
}
|
||||
}
|
||||
@ -228,6 +230,13 @@ where
|
||||
self
|
||||
}
|
||||
|
||||
/// Tells lightningd explicitly to allow custommmessages of the provided
|
||||
/// type
|
||||
pub fn custommessages(mut self, custommessages : Vec<u16>) -> Self {
|
||||
self.custommessages = custommessages;
|
||||
self
|
||||
}
|
||||
|
||||
/// Communicate with `lightningd` to tell it about our options,
|
||||
/// RPC methods and subscribe to hooks, and then process the
|
||||
/// initialization, configuring the plugin.
|
||||
@ -354,6 +363,7 @@ where
|
||||
notifications: self.notifications.clone(),
|
||||
dynamic: self.dynamic,
|
||||
nonnumericids: true,
|
||||
custommessages : self.custommessages.clone()
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -178,6 +178,8 @@ pub(crate) struct GetManifestResponse {
|
||||
pub(crate) hooks: Vec<String>,
|
||||
pub(crate) dynamic: bool,
|
||||
pub(crate) nonnumericids: bool,
|
||||
#[serde(skip_serializing_if = "Vec::is_empty")]
|
||||
pub(crate) custommessages : Vec<u16>
|
||||
}
|
||||
|
||||
#[derive(Serialize, Default, Debug)]
|
||||
|
Loading…
Reference in New Issue
Block a user