From b0ce9a06dc37c598f8521a14919b1c6d1eb416f1 Mon Sep 17 00:00:00 2001 From: Joseph Poon Date: Thu, 14 Jan 2016 18:51:08 -0800 Subject: [PATCH] minor edit --- lnstate/lnstate.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lnstate/lnstate.go b/lnstate/lnstate.go index 02f6df07..cb69b555 100644 --- a/lnstate/lnstate.go +++ b/lnstate/lnstate.go @@ -228,6 +228,7 @@ func (l *LNChannel) CreateHTLC(h *PaymentDescriptor) error { //Validate the data err = l.validateHTLC(h, false) if err != nil { + l.Unlock() return err } //Update state as pre-commit @@ -239,7 +240,7 @@ func (l *LNChannel) CreateHTLC(h *PaymentDescriptor) error { } else { //Future version may be able to do this.. l.Unlock() - fmt.Errorf("Cannot pull money") + return fmt.Errorf("Cannot pull money") } return nil