protofsm: add a Name() method to the env

This'll be used later to uniquely identify state machines for
routing/dispatch purposes.
This commit is contained in:
Olaoluwa Osuntokun committed 2024-11-18 20:49:00 -08:00
1 parent 424ae09631
commit 44f035330b
1 file changed
+5
+5
View File
@@ -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