From 44f035330b4a8d993fb365633929314f86d40162 Mon Sep 17 00:00:00 2001 From: Olaoluwa Osuntokun Date: Thu, 25 Jan 2024 17:27:48 -0800 Subject: [PATCH] protofsm: add a Name() method to the env This'll be used later to uniquely identify state machines for routing/dispatch purposes. --- protofsm/state_machine.go | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/protofsm/state_machine.go b/protofsm/state_machine.go index 0dfa8e73e..2a62ac223 100644 --- a/protofsm/state_machine.go +++ b/protofsm/state_machine.go @@ -220,6 +220,11 @@ func (s *StateMachine[Event, Env]) CanHandle(msg lnwire.Message) bool { }) } +// Name returns the name of the state machine's environment. +func (s *StateMachine[Event, Env]) Name() string { + return s.cfg.Env.Name() +} + // SendMessage attempts to send a wire message to the state machine. If the // message can be mapped using the default message mapper, then true is // returned indicating that the message was processed. Otherwise, false is