Skip to content

Commit 44f0353

Browse files
committed
protofsm: add a Name() method to the env
This'll be used later to uniquely identify state machines for routing/dispatch purposes.
1 parent 424ae09 commit 44f0353

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

protofsm/state_machine.go

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -220,6 +220,11 @@ func (s *StateMachine[Event, Env]) CanHandle(msg lnwire.Message) bool {
220220
})
221221
}
222222

223+
// Name returns the name of the state machine's environment.
224+
func (s *StateMachine[Event, Env]) Name() string {
225+
return s.cfg.Env.Name()
226+
}
227+
223228
// SendMessage attempts to send a wire message to the state machine. If the
224229
// message can be mapped using the default message mapper, then true is
225230
// returned indicating that the message was processed. Otherwise, false is

0 commit comments

Comments
 (0)