Skip to content

Commit 2e67696

Browse files
committed
rpcserver: check channel balance on keysend
1 parent e0d18c6 commit 2e67696

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

rpcserver.go

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7743,8 +7743,15 @@ func (r *rpcServer) SendPayment(req *tchrpc.SendPaymentRequest,
77437743
"for keysend payment")
77447744
}
77457745

7746-
var balances []*rfqmsg.AssetBalance
7746+
// We check that we have the asset amount available in the
7747+
// channel.
7748+
_, err := r.rfqChannel(ctx, specifier, nil, SendIntention)
7749+
if err != nil {
7750+
return fmt.Errorf("error finding asset channel to "+
7751+
"use: %w", err)
7752+
}
77477753

7754+
var balances []*rfqmsg.AssetBalance
77487755
switch {
77497756
case specifier.HasId():
77507757
balances = []*rfqmsg.AssetBalance{

0 commit comments

Comments
 (0)