Fix a shadowed return parameter.
This commit is contained in:
parent
7d679a6228
commit
5e4c78a1b7
1 changed files with 5 additions and 6 deletions
|
@ -23,12 +23,12 @@ func (db *SqliteDb) InsertBlockData(sha *btcwire.ShaHash, prevSha *btcwire.ShaHa
|
||||||
// insertSha stores a block hash and its associated data block with a
|
// insertSha stores a block hash and its associated data block with a
|
||||||
// previous sha of `prevSha' and a version of `pver'.
|
// previous sha of `prevSha' and a version of `pver'.
|
||||||
// insertSha shall be called with db lock held
|
// insertSha shall be called with db lock held
|
||||||
func (db *SqliteDb) insertBlockData(sha *btcwire.ShaHash, prevSha *btcwire.ShaHash, pver uint32, buf []byte) (blockid int64, err error) {
|
func (db *SqliteDb) insertBlockData(sha *btcwire.ShaHash, prevSha *btcwire.ShaHash, pver uint32, buf []byte) (int64, error) {
|
||||||
tx := &db.txState
|
tx := &db.txState
|
||||||
if tx.tx == nil {
|
if tx.tx == nil {
|
||||||
err = db.startTx()
|
err := db.startTx()
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return
|
return 0, err
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -48,7 +48,7 @@ func (db *SqliteDb) insertBlockData(sha *btcwire.ShaHash, prevSha *btcwire.ShaHa
|
||||||
|
|
||||||
result, err := db.blkStmts[blkInsertSha].Exec(sha.Bytes(), pver, buf)
|
result, err := db.blkStmts[blkInsertSha].Exec(sha.Bytes(), pver, buf)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return
|
return 0, err
|
||||||
}
|
}
|
||||||
|
|
||||||
blkid, err := result.LastInsertId()
|
blkid, err := result.LastInsertId()
|
||||||
|
@ -68,8 +68,7 @@ func (db *SqliteDb) insertBlockData(sha *btcwire.ShaHash, prevSha *btcwire.ShaHa
|
||||||
tx.txInsertList = append(tx.txInsertList, bid)
|
tx.txInsertList = append(tx.txInsertList, bid)
|
||||||
tx.txDataSz += len(buf)
|
tx.txDataSz += len(buf)
|
||||||
|
|
||||||
blockid = blkid
|
return blkid, nil
|
||||||
return
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// fetchSha returns the datablock and pver for the given ShaHash.
|
// fetchSha returns the datablock and pver for the given ShaHash.
|
||||||
|
|
Loading…
Reference in a new issue