lnd.xprv/watchtower/wtmock
Wilmer Paulino c760700545
wtmock: prevent race conditions by not using ClientSession pointers
These race conditions originate from the mock database storing and
returning pointers, rather than returning a copy.

Observed on Travis:

WARNING: DATA RACE
Read at 0x00c0003222b8 by goroutine 149:
  github.com/lightningnetwork/lnd/watchtower/wtclient.(*sessionQueue).drainBackups()
      /home/runner/work/lnd/lnd/watchtower/wtclient/session_queue.go:288 +0xed
  github.com/lightningnetwork/lnd/watchtower/wtclient.(*sessionQueue).sessionManager()
      /home/runner/work/lnd/lnd/watchtower/wtclient/session_queue.go:281 +0x450

Previous write at 0x00c0003222b8 by goroutine 93:
  github.com/lightningnetwork/lnd/watchtower/wtclient.getClientSessions()
      /home/runner/work/lnd/lnd/watchtower/wtclient/client.go:365 +0x24f
  github.com/lightningnetwork/lnd/watchtower/wtclient.(*TowerClient).handleNewTower()
      /home/runner/work/lnd/lnd/watchtower/wtclient/client.go:1063 +0x23e
  github.com/lightningnetwork/lnd/watchtower/wtclient.(*TowerClient).backupDispatcher()
      /home/runner/work/lnd/lnd/watchtower/wtclient/client.go:784 +0x10b9
2020-05-14 15:39:03 -07:00
..
client_db.go wtmock: prevent race conditions by not using ClientSession pointers 2020-05-14 15:39:03 -07:00
keyring.go watchtower/wtclient/interface: add SecretKeyRing iface 2019-04-23 20:03:15 -07:00
peer.go watchtower/wtmock/peer: set local pubkey 2019-03-15 02:34:00 -07:00
signer.go multi: return input.Signature from SignOutputRaw 2020-04-10 14:27:35 -07:00
tower_db.go watchtower/wtdb: apply sanity checks to session policy before accepting 2019-06-13 19:54:22 -07:00