Skip to content
Merged
Show file tree
Hide file tree
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
3 changes: 2 additions & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ require (
require (
dario.cat/mergo v1.0.1 // indirect
github.com/Azure/go-ansiterm v0.0.0-20230124172434-306776ec8161 // indirect
github.com/BurntSushi/toml v1.3.2 // indirect
github.com/Microsoft/go-winio v0.6.1 // indirect
github.com/Nvveen/Gotty v0.0.0-20120604004816-cd527374f1e5 // indirect
github.com/aead/chacha20 v0.0.0-20180709150244-8b13a72661da // indirect
Expand Down Expand Up @@ -118,7 +119,7 @@ require (
github.com/ncruces/go-strftime v0.1.9 // indirect
github.com/opencontainers/go-digest v1.0.0 // indirect
github.com/opencontainers/image-spec v1.0.2 // indirect
github.com/opencontainers/runc v1.2.0 // indirect
github.com/opencontainers/runc v1.2.8 // indirect
github.com/ory/dockertest/v3 v3.10.0 // indirect
github.com/pkg/errors v0.9.1 // indirect
github.com/pmezard/go-difflib v1.0.0 // indirect
Expand Down
7 changes: 4 additions & 3 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,9 @@ dario.cat/mergo v1.0.1 h1:Ra4+bf83h2ztPIQYNP99R6m+Y7KfnARDfID+a+vLl4s=
dario.cat/mergo v1.0.1/go.mod h1:uNxQE+84aUszobStD9th8a29P2fMDhsBdgRYvZOxGmk=
github.com/Azure/go-ansiterm v0.0.0-20230124172434-306776ec8161 h1:L/gRVlceqvL25UVaW/CKtUDjefjrs0SPonmDGUVOYP0=
github.com/Azure/go-ansiterm v0.0.0-20230124172434-306776ec8161/go.mod h1:xomTg63KZ2rFqZQzSB4Vz2SUXa1BpHTVz9L5PTmPC4E=
github.com/BurntSushi/toml v0.3.1 h1:WXkYYl6Yr3qBf1K79EBnL4mak0OimBfB0XUf9Vl28OQ=
github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU=
github.com/BurntSushi/toml v1.3.2 h1:o7IhLm0Msx3BaB+n3Ag7L8EVlByGnpq14C4YWiu/gL8=
github.com/BurntSushi/toml v1.3.2/go.mod h1:CxXYINrC8qIiEnFrOxCa7Jy5BFHlXnUU2pbicEuybxQ=
github.com/Masterminds/semver/v3 v3.1.1 h1:hLg3sBzpNErnxhQtUy/mmLR2I9foDujNK030IGemrRc=
github.com/Masterminds/semver/v3 v3.1.1/go.mod h1:VPu/7SZ7ePZ3QOrcuXROw5FAcLl4a0cBrbBpGY/8hQs=
github.com/Microsoft/go-winio v0.6.1 h1:9/kr64B9VUZrLm5YYwbGtUJnMgqWVOdUAXu6Migciow=
Expand Down Expand Up @@ -429,8 +430,8 @@ github.com/opencontainers/go-digest v1.0.0 h1:apOUWs51W5PlhuyGyz9FCeeBIOUDA/6nW8
github.com/opencontainers/go-digest v1.0.0/go.mod h1:0JzlMkj0TRzQZfJkVvzbP0HBR3IKzErnv2BNG4W4MAM=
github.com/opencontainers/image-spec v1.0.2 h1:9yCKha/T5XdGtO0q9Q9a6T5NUCsTn/DrBg0D7ufOcFM=
github.com/opencontainers/image-spec v1.0.2/go.mod h1:BtxoFyWECRxE4U/7sNtV5W15zMzWCbyJoFRP3s7yZA0=
github.com/opencontainers/runc v1.2.0 h1:qke7ZVCmJcKrJVY2iHJVC+0kql9uYdkusOPsQOOeBw4=
github.com/opencontainers/runc v1.2.0/go.mod h1:/PXzF0h531HTMsYQnmxXkBD7YaGShm/2zcRB79dksUc=
github.com/opencontainers/runc v1.2.8 h1:RnEICeDReapbZ5lZEgHvj7E9Q3Eex9toYmaGBsbvU5Q=
github.com/opencontainers/runc v1.2.8/go.mod h1:cC0YkmZcuvr+rtBZ6T7NBoVbMGNAdLa/21vIElJDOzI=
github.com/opentracing/opentracing-go v1.1.0/go.mod h1:UkNAQd3GIcIGf0SeVgPpRdFStlNbqXla1AfSYxPUl2o=
github.com/ory/dockertest/v3 v3.10.0 h1:4K3z2VMe8Woe++invjaTB7VRyQXQy5UY+loujO4aNE4=
github.com/ory/dockertest/v3 v3.10.0/go.mod h1:nr57ZbRWMqfsdGdFNLHz5jjNdDb7VVFnzAeW1n5N1Lg=
Expand Down
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 @@ -3631,25 +3631,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