From 0bd4b7cf8920757323e779ec99ca8133dea28a66 Mon Sep 17 00:00:00 2001 From: Slyghtning Date: Mon, 27 Nov 2023 13:46:18 +0100 Subject: [PATCH] loopdb: state insufficient confirmed funds --- loopd/swapclient_server.go | 3 +++ loopdb/swapstate.go | 7 +++++++ 2 files changed, 10 insertions(+) diff --git a/loopd/swapclient_server.go b/loopd/swapclient_server.go index be135a7..f4f4592 100644 --- a/loopd/swapclient_server.go +++ b/loopd/swapclient_server.go @@ -291,6 +291,9 @@ func (s *swapClientServer) marshallSwap(loopSwap *loop.SwapInfo) ( case loopdb.StateFailAbandoned: failureReason = clientrpc.FailureReason_FAILURE_REASON_ABANDONED + case loopdb.StateFailInsufficientConfirmedBalance: + failureReason = clientrpc.FailureReason_FAILURE_REASON_INSUFFICIENT_CONFIRMED_BALANCE + default: return nil, fmt.Errorf("unknown swap state: %v", loopSwap.State) } diff --git a/loopdb/swapstate.go b/loopdb/swapstate.go index 12c207b..f18ca29 100644 --- a/loopdb/swapstate.go +++ b/loopdb/swapstate.go @@ -68,6 +68,10 @@ const ( // StateFailAbandoned indicates that a swap has been abandoned. Its // execution has been canceled. It won't further be processed. StateFailAbandoned SwapState = 11 + + // StateFailInsufficientConfirmedBalance indicates that the swap wasn't + // published due to insufficient confirmed balance. + StateFailInsufficientConfirmedBalance SwapState = 12 ) // SwapStateType defines the types of swap states that exist. Every swap state @@ -153,6 +157,9 @@ func (s SwapState) String() string { case StateFailAbandoned: return "FailAbandoned" + case StateFailInsufficientConfirmedBalance: + return "InsufficientConfirmedBalance" + default: return "Unknown" }