Skip to content

Commit 2249c41

Browse files
stariushieblmi
authored andcommitted
loopdb: switch to go.etcd.io/bbolt
github.com/coreos/bbolt has race conditions: golang/go#54690
1 parent d2c08bb commit 2249c41

13 files changed

+12
-15
lines changed

go.mod

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@ require (
99
github.com/btcsuite/btclog v0.0.0-20241003133417-09c4e92e319c // indirect
1010
github.com/btcsuite/btcwallet v0.16.10-0.20241127094224-93c858b2ad63
1111
github.com/btcsuite/btcwallet/wtxmgr v1.5.4
12-
github.com/coreos/bbolt v1.3.3
1312
github.com/davecgh/go-spew v1.1.1
1413
github.com/decred/dcrd/dcrec/secp256k1/v4 v4.3.0
1514
github.com/fortytw2/leaktest v1.3.0
@@ -35,6 +34,7 @@ require (
3534
github.com/ory/dockertest/v3 v3.10.0
3635
github.com/stretchr/testify v1.9.0
3736
github.com/urfave/cli v1.22.9
37+
go.etcd.io/bbolt v1.3.11
3838
golang.org/x/net v0.36.0
3939
google.golang.org/grpc v1.64.1
4040
google.golang.org/protobuf v1.34.2
@@ -164,7 +164,6 @@ require (
164164
github.com/xi2/xz v0.0.0-20171230120015-48954b6210f8 // indirect
165165
github.com/xiang90/probing v0.0.0-20190116061207-43a291ad63a2 // indirect
166166
gitlab.com/yawning/bsaes.git v0.0.0-20190805113838-0a714cd429ec // indirect
167-
go.etcd.io/bbolt v1.3.11 // indirect
168167
go.etcd.io/etcd/api/v3 v3.5.12 // indirect
169168
go.etcd.io/etcd/client/pkg/v3 v3.5.12 // indirect
170169
go.etcd.io/etcd/client/v2 v2.305.12 // indirect

go.sum

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -732,8 +732,6 @@ github.com/cockroachdb/datadriven v1.0.2 h1:H9MtNqVoVhvd9nCBwOyDjUEdZCREqbIdCJD9
732732
github.com/cockroachdb/datadriven v1.0.2/go.mod h1:a9RdTaap04u637JoCzcUoIcDmvwSUtcUFtT/C3kJlTU=
733733
github.com/containerd/continuity v0.3.0 h1:nisirsYROK15TAMVukJOUyGJjz4BNQJBVsNvAXZJ/eg=
734734
github.com/containerd/continuity v0.3.0/go.mod h1:wJEAIwKOm/pBZuBd0JmeTvnLquTB1Ag8espWhkykbPM=
735-
github.com/coreos/bbolt v1.3.3 h1:n6AiVyVRKQFNb6mJlwESEvvLoDyiTzXX7ORAUlkeBdY=
736-
github.com/coreos/bbolt v1.3.3/go.mod h1:iRUV2dpdMOn7Bo10OQBFzIJO9kkE559Wcmn+qkEiiKk=
737735
github.com/coreos/go-semver v0.3.0 h1:wkHLiw0WNATZnSG7epLsujiMCgPAc9xhjJ4tgnAxmfM=
738736
github.com/coreos/go-semver v0.3.0/go.mod h1:nnelYz7RCh+5ahJtPPxZlU+153eP4D4r3EedlOD2RNk=
739737
github.com/coreos/go-systemd v0.0.0-20190321100706-95778dfbb74e/go.mod h1:F5haX7vjVVG0kc13fIWeqUViNPyEJxv/OmvnBo0Yme4=

loopd/daemon.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@ import (
1212
"sync/atomic"
1313
"time"
1414

15-
"github.com/coreos/bbolt"
1615
proxy "github.com/grpc-ecosystem/grpc-gateway/v2/runtime"
1716
"github.com/lightninglabs/lndclient"
1817
"github.com/lightninglabs/loop"
@@ -33,6 +32,7 @@ import (
3332
"github.com/lightningnetwork/lnd/clock"
3433
"github.com/lightningnetwork/lnd/lntypes"
3534
"github.com/lightningnetwork/lnd/macaroons"
35+
"go.etcd.io/bbolt"
3636
"google.golang.org/grpc"
3737
"google.golang.org/protobuf/encoding/protojson"
3838
"gopkg.in/macaroon-bakery.v2/bakery"

loopdb/loopin.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,9 @@ import (
66
"fmt"
77
"time"
88

9-
"github.com/coreos/bbolt"
109
"github.com/lightninglabs/loop/labels"
1110
"github.com/lightningnetwork/lnd/routing/route"
11+
"go.etcd.io/bbolt"
1212
)
1313

1414
// LoopInContract contains the data that is serialized to persistent storage for

loopdb/meta.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ import (
55
"fmt"
66

77
"github.com/btcsuite/btcd/chaincfg"
8-
"github.com/coreos/bbolt"
8+
"go.etcd.io/bbolt"
99
)
1010

1111
var (

loopdb/migration_01_costs.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ import (
55
"fmt"
66

77
"github.com/btcsuite/btcd/chaincfg"
8-
"github.com/coreos/bbolt"
8+
"go.etcd.io/bbolt"
99
)
1010

1111
// noMigrationAvailable is the fall back migration in case there is no migration

loopdb/migration_02_swap_publication_deadline.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ import (
66
"fmt"
77

88
"github.com/btcsuite/btcd/chaincfg"
9-
"github.com/coreos/bbolt"
9+
"go.etcd.io/bbolt"
1010
)
1111

1212
// migrateSwapPublicationDeadline migrates the database to v02, by adding the

loopdb/migration_03_last_hop.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ import (
66
"fmt"
77

88
"github.com/btcsuite/btcd/chaincfg"
9-
"github.com/coreos/bbolt"
9+
"go.etcd.io/bbolt"
1010
)
1111

1212
// migrateLastHop migrates the database to v03, replacing the never used loop in

loopdb/migration_04_updates.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ import (
55
"fmt"
66

77
"github.com/btcsuite/btcd/chaincfg"
8-
"github.com/coreos/bbolt"
8+
"go.etcd.io/bbolt"
99
)
1010

1111
// migrateUpdates migrates the swap updates to add an additional level of

loopdb/migration_04_updates_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,8 @@ import (
88
"testing"
99

1010
"github.com/btcsuite/btcd/chaincfg"
11-
"github.com/coreos/bbolt"
1211
"github.com/stretchr/testify/require"
12+
"go.etcd.io/bbolt"
1313
)
1414

1515
// TestMigrationUpdates asserts that the swap updates migration is carried out

0 commit comments

Comments
 (0)