mirror of
https://github.com/aljazceru/lspd.git
synced 2025-12-23 00:34:21 +01:00
Add default channel acceptor
- Implemented a default channel acceptor script for the channel acceptor in 'channel_acceptor.go'. If no accept script is provided, the default script is set to "continue". - Updated 'cln_plugin.go' to include a new DefaultChannelAcceptorScript variable with an empty string default value. - Updated the handleGetManifest function to include DefaultChannelAcceptorScript as a default for the 'channelAcceptScript' field.
This commit is contained in:
@@ -12,6 +12,13 @@ func channelAcceptor(acceptScript string, method string, openChannel json.RawMes
|
||||
reject, _ := json.Marshal(struct {
|
||||
Result string `json:"result"`
|
||||
}{Result: "reject"})
|
||||
accept, _ := json.Marshal(struct {
|
||||
Result string `json:"result"`
|
||||
}{Result: "continue"})
|
||||
|
||||
if acceptScript == "" {
|
||||
return accept, nil
|
||||
}
|
||||
|
||||
sd := starlark.StringDict{
|
||||
"method": starlark.String(method),
|
||||
|
||||
@@ -24,6 +24,7 @@ const (
|
||||
|
||||
var (
|
||||
DefaultSubscriberTimeout = "1m"
|
||||
DefaultChannelAcceptorScript = ""
|
||||
)
|
||||
|
||||
const (
|
||||
@@ -259,6 +260,7 @@ func (c *ClnPlugin) handleGetManifest(request *Request) {
|
||||
Name: channelAcceptScript,
|
||||
Type: "string",
|
||||
Description: "starlark script for channel acceptor.",
|
||||
Default: &DefaultChannelAcceptorScript,
|
||||
},
|
||||
},
|
||||
RpcMethods: []*RpcMethod{
|
||||
|
||||
Reference in New Issue
Block a user