From 4d630765261ac7f219a289ae9018cc82f5f496b3 Mon Sep 17 00:00:00 2001 From: Dale Rahn Date: Tue, 15 Apr 2014 10:16:10 -0400 Subject: [PATCH] All external entry points into the database must be locked. --- ldb/tx.go | 3 +++ 1 file changed, 3 insertions(+) diff --git a/ldb/tx.go b/ldb/tx.go index d9ff9a60..0ecdf413 100644 --- a/ldb/tx.go +++ b/ldb/tx.go @@ -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 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 // to FetchUnSpentTxByShaList replies := make([]*btcdb.TxListReply, len(txShaList))