From 6f4a9d86613dda0b64b8884f5a3a4d7ad2dc4083 Mon Sep 17 00:00:00 2001 From: yyforyongyu Date: Tue, 14 Dec 2021 03:12:00 +0800 Subject: [PATCH] funding: add String method for channelOpeningState The newly added String method can be helpful in reading logs. --- funding/manager.go | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/funding/manager.go b/funding/manager.go index 031b9e770..2a7b9bdb9 100644 --- a/funding/manager.go +++ b/funding/manager.go @@ -553,6 +553,19 @@ const ( addedToRouterGraph ) +func (c channelOpeningState) String() string { + switch c { + case markedOpen: + return "markedOpen" + case fundingLockedSent: + return "fundingLocked" + case addedToRouterGraph: + return "addedToRouterGraph" + default: + return "unknown" + } +} + // NewFundingManager creates and initializes a new instance of the // fundingManager. func NewFundingManager(cfg Config) (*Manager, error) {