All external entry points into the database must be locked.

This commit is contained in:
Dale Rahn 2014-04-15 10:16:10 -04:00
parent 1b51d58e55
commit 4d63076526

View file

@ -251,6 +251,9 @@ func (db *LevelDb) existsTxSha(txSha *btcwire.ShaHash) (exists bool) {
// FetchTxByShaList returns the most recent tx of the name fully spent or not // FetchTxByShaList returns the most recent tx of the name fully spent or not
func (db *LevelDb) FetchTxByShaList(txShaList []*btcwire.ShaHash) []*btcdb.TxListReply { func (db *LevelDb) FetchTxByShaList(txShaList []*btcwire.ShaHash) []*btcdb.TxListReply {
db.dbLock.Lock()
defer db.dbLock.Unlock()
// until the fully spent separation of tx is complete this is identical // until the fully spent separation of tx is complete this is identical
// to FetchUnSpentTxByShaList // to FetchUnSpentTxByShaList
replies := make([]*btcdb.TxListReply, len(txShaList)) replies := make([]*btcdb.TxListReply, len(txShaList))