Skip to content

Commit 19d969a

Browse files
authored
Merge pull request #254 from starius/porting-master-to-20
Port "SendCoins: use SatPerVbyte" and "bump runc to 1.2.8" to lnd-20-0
2 parents bce7746 + 0377cc8 commit 19d969a

File tree

3 files changed

+18
-16
lines changed

3 files changed

+18
-16
lines changed

go.mod

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ require (
2020
require (
2121
dario.cat/mergo v1.0.1 // indirect
2222
github.com/Azure/go-ansiterm v0.0.0-20230124172434-306776ec8161 // indirect
23+
github.com/BurntSushi/toml v1.3.2 // indirect
2324
github.com/Microsoft/go-winio v0.6.1 // indirect
2425
github.com/Nvveen/Gotty v0.0.0-20120604004816-cd527374f1e5 // indirect
2526
github.com/aead/chacha20 v0.0.0-20180709150244-8b13a72661da // indirect
@@ -118,7 +119,7 @@ require (
118119
github.com/ncruces/go-strftime v0.1.9 // indirect
119120
github.com/opencontainers/go-digest v1.0.0 // indirect
120121
github.com/opencontainers/image-spec v1.0.2 // indirect
121-
github.com/opencontainers/runc v1.2.0 // indirect
122+
github.com/opencontainers/runc v1.2.8 // indirect
122123
github.com/ory/dockertest/v3 v3.10.0 // indirect
123124
github.com/pkg/errors v0.9.1 // indirect
124125
github.com/pmezard/go-difflib v1.0.0 // indirect

go.sum

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,9 @@ dario.cat/mergo v1.0.1 h1:Ra4+bf83h2ztPIQYNP99R6m+Y7KfnARDfID+a+vLl4s=
99
dario.cat/mergo v1.0.1/go.mod h1:uNxQE+84aUszobStD9th8a29P2fMDhsBdgRYvZOxGmk=
1010
github.com/Azure/go-ansiterm v0.0.0-20230124172434-306776ec8161 h1:L/gRVlceqvL25UVaW/CKtUDjefjrs0SPonmDGUVOYP0=
1111
github.com/Azure/go-ansiterm v0.0.0-20230124172434-306776ec8161/go.mod h1:xomTg63KZ2rFqZQzSB4Vz2SUXa1BpHTVz9L5PTmPC4E=
12-
github.com/BurntSushi/toml v0.3.1 h1:WXkYYl6Yr3qBf1K79EBnL4mak0OimBfB0XUf9Vl28OQ=
1312
github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU=
13+
github.com/BurntSushi/toml v1.3.2 h1:o7IhLm0Msx3BaB+n3Ag7L8EVlByGnpq14C4YWiu/gL8=
14+
github.com/BurntSushi/toml v1.3.2/go.mod h1:CxXYINrC8qIiEnFrOxCa7Jy5BFHlXnUU2pbicEuybxQ=
1415
github.com/Masterminds/semver/v3 v3.1.1 h1:hLg3sBzpNErnxhQtUy/mmLR2I9foDujNK030IGemrRc=
1516
github.com/Masterminds/semver/v3 v3.1.1/go.mod h1:VPu/7SZ7ePZ3QOrcuXROw5FAcLl4a0cBrbBpGY/8hQs=
1617
github.com/Microsoft/go-winio v0.6.1 h1:9/kr64B9VUZrLm5YYwbGtUJnMgqWVOdUAXu6Migciow=
@@ -429,8 +430,8 @@ github.com/opencontainers/go-digest v1.0.0 h1:apOUWs51W5PlhuyGyz9FCeeBIOUDA/6nW8
429430
github.com/opencontainers/go-digest v1.0.0/go.mod h1:0JzlMkj0TRzQZfJkVvzbP0HBR3IKzErnv2BNG4W4MAM=
430431
github.com/opencontainers/image-spec v1.0.2 h1:9yCKha/T5XdGtO0q9Q9a6T5NUCsTn/DrBg0D7ufOcFM=
431432
github.com/opencontainers/image-spec v1.0.2/go.mod h1:BtxoFyWECRxE4U/7sNtV5W15zMzWCbyJoFRP3s7yZA0=
432-
github.com/opencontainers/runc v1.2.0 h1:qke7ZVCmJcKrJVY2iHJVC+0kql9uYdkusOPsQOOeBw4=
433-
github.com/opencontainers/runc v1.2.0/go.mod h1:/PXzF0h531HTMsYQnmxXkBD7YaGShm/2zcRB79dksUc=
433+
github.com/opencontainers/runc v1.2.8 h1:RnEICeDReapbZ5lZEgHvj7E9Q3Eex9toYmaGBsbvU5Q=
434+
github.com/opencontainers/runc v1.2.8/go.mod h1:cC0YkmZcuvr+rtBZ6T7NBoVbMGNAdLa/21vIElJDOzI=
434435
github.com/opentracing/opentracing-go v1.1.0/go.mod h1:UkNAQd3GIcIGf0SeVgPpRdFStlNbqXla1AfSYxPUl2o=
435436
github.com/ory/dockertest/v3 v3.10.0 h1:4K3z2VMe8Woe++invjaTB7VRyQXQy5UY+loujO4aNE4=
436437
github.com/ory/dockertest/v3 v3.10.0/go.mod h1:nr57ZbRWMqfsdGdFNLHz5jjNdDb7VVFnzAeW1n5N1Lg=

lightning_client.go

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -209,12 +209,12 @@ type LightningClient interface {
209209

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

219219
// ChannelBalance returns a summary of our channel balances.
220220
ChannelBalance(ctx context.Context) (*ChannelBalance, error)
@@ -3631,25 +3631,25 @@ func (s *lightningClient) Connect(ctx context.Context, peer route.Vertex,
36313631
}
36323632

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

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

36443644
rpcCtx = s.adminMac.WithMacaroonAuth(rpcCtx)
36453645

36463646
req := &lnrpc.SendCoinsRequest{
3647-
Addr: addr.String(),
3648-
Amount: int64(amount),
3649-
TargetConf: confTarget,
3650-
SatPerByte: satsPerByte,
3651-
SendAll: sendAll,
3652-
Label: label,
3647+
Addr: addr.String(),
3648+
Amount: int64(amount),
3649+
TargetConf: confTarget,
3650+
SatPerVbyte: uint64(satsPerVByte),
3651+
SendAll: sendAll,
3652+
Label: label,
36533653
}
36543654

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

0 commit comments

Comments
 (0)