Skip to content

Commit 9469267

Browse files
committed
looprpc: add swap multiple swap scripts server state to rpc enum
Add a new failure state that the server may send to the client. This state is sent for loop in swaps where the client has erroneously published multiple outputs for a loop in swap (this could happen if an end user created an external tx with too many outputs). Failing the swap server side protects users from potential footguns where they publish the hltc then the server can claim more money than was paid out off chain. This can never happen when the loop client publishes the htlc because it only ever contains one output.
1 parent e7ee29b commit 9469267

File tree

2 files changed

+109
-95
lines changed

2 files changed

+109
-95
lines changed

looprpc/server.pb.go

Lines changed: 103 additions & 95 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

looprpc/server.proto

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -305,6 +305,12 @@ enum ServerSwapState {
305305
// The client canceled the swap because they could not route the swap
306306
// payment.
307307
SERVER_CLIENT_INVOICE_CANCEL = 14;
308+
309+
/*
310+
A loop in swap was rejected because it contained multiple outputs for a
311+
single swap.
312+
*/
313+
SERVER_FAILED_MULTIPLE_SWAP_SCRIPTS = 15;
308314
}
309315

310316
message SubscribeLoopOutUpdatesResponse {

0 commit comments

Comments
 (0)