Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 12 additions & 12 deletions lightning_client.go
Original file line number Diff line number Diff line change
Expand Up @@ -209,12 +209,12 @@ type LightningClient interface {

// SendCoins sends the passed amount of (or all) coins to the passed
// address. Either amount or sendAll must be specified, while
// confTarget, satsPerByte are optional and may be set to zero in which
// confTarget, satsPerVByte are optional and may be set to zero in which
// case automatic conf target and fee will be used. Returns the tx id
// upon success.
SendCoins(ctx context.Context, addr btcutil.Address,
amount btcutil.Amount, sendAll bool, confTarget int32,
satsPerByte int64, label string) (string, error)
satsPerVByte chainfee.SatPerVByte, label string) (string, error)

// ChannelBalance returns a summary of our channel balances.
ChannelBalance(ctx context.Context) (*ChannelBalance, error)
Expand Down Expand Up @@ -3592,25 +3592,25 @@ func (s *lightningClient) Connect(ctx context.Context, peer route.Vertex,
}

// SendCoins sends the passed amount of (or all) coins to the passed address.
// Either amount or sendAll must be specified, while confTarget, satsPerByte are
// optional and may be set to zero in which case automatic conf target and fee
// will be used. Returns the tx id upon success.
// Either amount or sendAll must be specified, while confTarget, satsPerVByte
// are optional and may be set to zero in which case automatic conf target and
// fee will be used. Returns the tx id upon success.
func (s *lightningClient) SendCoins(ctx context.Context, addr btcutil.Address,
amount btcutil.Amount, sendAll bool, confTarget int32,
satsPerByte int64, label string) (string, error) {
satsPerVByte chainfee.SatPerVByte, label string) (string, error) {

rpcCtx, cancel := context.WithTimeout(ctx, s.timeout)
defer cancel()

rpcCtx = s.adminMac.WithMacaroonAuth(rpcCtx)

req := &lnrpc.SendCoinsRequest{
Addr: addr.String(),
Amount: int64(amount),
TargetConf: confTarget,
SatPerByte: satsPerByte,
SendAll: sendAll,
Label: label,
Addr: addr.String(),
Amount: int64(amount),
TargetConf: confTarget,
SatPerVbyte: uint64(satsPerVByte),
SendAll: sendAll,
Label: label,
}

resp, err := s.client.SendCoins(rpcCtx, req)
Expand Down