Remove obsolete API functions
This commit is contained in:
parent
9abf071308
commit
78d4bfecd4
3 changed files with 4 additions and 34 deletions
|
@ -11,15 +11,6 @@ import (
|
|||
_ "github.com/mattn/go-sqlite3"
|
||||
)
|
||||
|
||||
// InsertBlockData stores a block hash and its associated data block with a
|
||||
// previous sha of `prevSha' and a version of `pver'.
|
||||
func (db *SqliteDb) InsertBlockData(sha *btcwire.ShaHash, prevSha *btcwire.ShaHash, pver uint32, buf []byte) (blockid int64, err error) {
|
||||
db.dbLock.Lock()
|
||||
defer db.dbLock.Unlock()
|
||||
|
||||
return db.insertBlockData(sha, prevSha, pver, buf)
|
||||
}
|
||||
|
||||
// insertSha stores a block hash and its associated data block with a
|
||||
// previous sha of `prevSha' and a version of `pver'.
|
||||
// insertSha shall be called with db lock held
|
||||
|
|
|
@ -228,8 +228,8 @@ func (db *SqliteDb) fetchTxDataBySha(txsha *btcwire.ShaHash) (rtx *btcwire.MsgTx
|
|||
return &tx, txbuf, pver, blksha, height, txspent, nil
|
||||
}
|
||||
|
||||
// FetchTxAllBySha returns several pieces of data regarding the given sha.
|
||||
func (db *SqliteDb) FetchTxAllBySha(txsha *btcwire.ShaHash) (rtx *btcwire.MsgTx, rtxbuf []byte, rpver uint32, rblksha *btcwire.ShaHash, err error) {
|
||||
// FetchTxBySha returns several pieces of data regarding the given sha.
|
||||
func (db *SqliteDb) FetchTxBySha(txsha *btcwire.ShaHash) (rtx *btcwire.MsgTx, rpver uint32, rblksha *btcwire.ShaHash, err error) {
|
||||
var pver uint32
|
||||
var blksha *btcwire.ShaHash
|
||||
var height int64
|
||||
|
@ -240,7 +240,7 @@ func (db *SqliteDb) FetchTxAllBySha(txsha *btcwire.ShaHash) (rtx *btcwire.MsgTx,
|
|||
|
||||
// Check Tx cache
|
||||
if txc, ok := db.fetchTxCache(txsha); ok {
|
||||
return txc.tx, txc.txbuf, txc.pver, &txc.blksha, nil
|
||||
return txc.tx, txc.pver, &txc.blksha, nil
|
||||
}
|
||||
|
||||
// If not cached load it
|
||||
|
@ -293,20 +293,7 @@ func (db *SqliteDb) FetchTxAllBySha(txsha *btcwire.ShaHash) (rtx *btcwire.MsgTx,
|
|||
txc.blksha = *blksha
|
||||
db.insertTxCache(&txc)
|
||||
|
||||
return &tx, txbuf, pver, blksha, nil
|
||||
}
|
||||
|
||||
// FetchTxBySha returns some data for the given Tx Sha.
|
||||
func (db *SqliteDb) FetchTxBySha(txsha *btcwire.ShaHash) (rtx *btcwire.MsgTx, rpver uint32, blksha *btcwire.ShaHash, err error) {
|
||||
rtx, _, rpver, blksha, err = db.FetchTxAllBySha(txsha)
|
||||
return
|
||||
}
|
||||
|
||||
// FetchTxBufBySha return the bytestream data and associated protocol version.
|
||||
// for the given Tx Sha
|
||||
func (db *SqliteDb) FetchTxBufBySha(txsha *btcwire.ShaHash) (txbuf []byte, rpver uint32, err error) {
|
||||
_, txbuf, rpver, _, err = db.FetchTxAllBySha(txsha)
|
||||
return
|
||||
return &tx, pver, blksha, nil
|
||||
}
|
||||
|
||||
// fetchTxCache look up the given transaction in the Tx cache.
|
||||
|
|
|
@ -11,14 +11,6 @@ import (
|
|||
_ "github.com/mattn/go-sqlite3"
|
||||
)
|
||||
|
||||
// InsertTx inserts a tx hash and its associated data into the database.
|
||||
func (db *SqliteDb) InsertTx(txsha *btcwire.ShaHash, height int64, txoff int, txlen int, usedbuf []byte) (err error) {
|
||||
db.dbLock.Lock()
|
||||
defer db.dbLock.Unlock()
|
||||
|
||||
return db.insertTx(txsha, height, txoff, txlen, usedbuf)
|
||||
}
|
||||
|
||||
// insertTx inserts a tx hash and its associated data into the database.
|
||||
// Must be called with db lock held.
|
||||
func (db *SqliteDb) insertTx(txsha *btcwire.ShaHash, height int64, txoff int, txlen int, usedbuf []byte) (err error) {
|
||||
|
|
Loading…
Add table
Reference in a new issue