This query should be performed as part of the transaction, not outside it.
This commit is contained in:
parent
9e27c82a23
commit
1530141ba0
1 changed files with 1 additions and 1 deletions
|
@ -37,7 +37,7 @@ func (db *SqliteDb) insertBlockData(sha *btcwire.ShaHash, prevSha *btcwire.ShaHa
|
||||||
if prevOk := db.blkExistsSha(prevSha); !prevOk {
|
if prevOk := db.blkExistsSha(prevSha); !prevOk {
|
||||||
var numBlocks uint64
|
var numBlocks uint64
|
||||||
querystr := "SELECT COUNT(blockid) FROM block;"
|
querystr := "SELECT COUNT(blockid) FROM block;"
|
||||||
err := db.sqldb.QueryRow(querystr).Scan(&numBlocks)
|
err := tx.tx.QueryRow(querystr).Scan(&numBlocks)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return 0, err
|
return 0, err
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue