wtxmgr: prevent race condition by using local vars

This commit is contained in:
Wilmer Paulino 2021-02-22 17:38:28 -08:00
parent 39cbb7bdd9
commit 6ff982ccdc
No known key found for this signature in database
GPG key ID: 6DF57B9F9514972F

View file

@ -2284,11 +2284,11 @@ func TestTxLabel(t *testing.T) {
defer teardown() defer teardown()
// txid is the transaction hash we will use to write and get labels for. // txid is the transaction hash we will use to write and get labels for.
txid := TstRecvTx.Hash() txid := &chainhash.Hash{1}
// txidNotFound is distinct from txid, and will not have a label written // txidNotFound is distinct from txid, and will not have a label written
// to disk. // to disk.
txidNotFound := TstSpendingTx.Hash() txidNotFound := &chainhash.Hash{2}
// getBucket gets the top level bucket, and fails the test if it is // getBucket gets the top level bucket, and fails the test if it is
// not found. // not found.