Skip to content

Commit

Permalink
waddrmgr: test ScopedManager with root manager lock held
Browse files Browse the repository at this point in the history
  • Loading branch information
aakselrod committed Nov 25, 2024
1 parent 66a3aee commit 5838215
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions waddrmgr/manager_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -2439,6 +2439,14 @@ func TestScopedKeyManagerManagement(t *testing.T) {
err = walletdb.Update(db, func(tx walletdb.ReadWriteTx) error {
ns := tx.ReadWriteBucket(waddrmgrNamespaceKey)

// For this test, since we've fetched the scoped key manager,
// we want to check that this runs correctly while the root
// manager is locked for another task. This will be possible
// with Postgres-backed wallets having multiple connections to
// the database backend, executing transactions in parallel.
mgr.mtx.Lock()
defer mgr.mtx.Unlock()

// We'll now create a new external address to ensure we
// retrieve the proper type.
externalAddr, err = scopedMgr.NextExternalAddresses(
Expand Down

0 comments on commit 5838215

Please sign in to comment.