Skip to content

Commit 0bd4b7c

Browse files
committed
loopdb: state insufficient confirmed funds
1 parent 0060e3f commit 0bd4b7c

File tree

2 files changed

+10
-0
lines changed

2 files changed

+10
-0
lines changed

loopd/swapclient_server.go

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -291,6 +291,9 @@ func (s *swapClientServer) marshallSwap(loopSwap *loop.SwapInfo) (
291291
case loopdb.StateFailAbandoned:
292292
failureReason = clientrpc.FailureReason_FAILURE_REASON_ABANDONED
293293

294+
case loopdb.StateFailInsufficientConfirmedBalance:
295+
failureReason = clientrpc.FailureReason_FAILURE_REASON_INSUFFICIENT_CONFIRMED_BALANCE
296+
294297
default:
295298
return nil, fmt.Errorf("unknown swap state: %v", loopSwap.State)
296299
}

loopdb/swapstate.go

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,10 @@ const (
6868
// StateFailAbandoned indicates that a swap has been abandoned. Its
6969
// execution has been canceled. It won't further be processed.
7070
StateFailAbandoned SwapState = 11
71+
72+
// StateFailInsufficientConfirmedBalance indicates that the swap wasn't
73+
// published due to insufficient confirmed balance.
74+
StateFailInsufficientConfirmedBalance SwapState = 12
7175
)
7276

7377
// SwapStateType defines the types of swap states that exist. Every swap state
@@ -153,6 +157,9 @@ func (s SwapState) String() string {
153157
case StateFailAbandoned:
154158
return "FailAbandoned"
155159

160+
case StateFailInsufficientConfirmedBalance:
161+
return "InsufficientConfirmedBalance"
162+
156163
default:
157164
return "Unknown"
158165
}

0 commit comments

Comments
 (0)