mirror of
https://github.com/kaspanet/kaspad.git
synced 2025-06-22 14:02:32 +00:00
Remove obsolete API functions
This commit is contained in:
parent
9abf071308
commit
78d4bfecd4
@ -11,15 +11,6 @@ import (
|
|||||||
_ "github.com/mattn/go-sqlite3"
|
_ "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
|
// 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
|
||||||
|
@ -228,8 +228,8 @@ func (db *SqliteDb) fetchTxDataBySha(txsha *btcwire.ShaHash) (rtx *btcwire.MsgTx
|
|||||||
return &tx, txbuf, pver, blksha, height, txspent, nil
|
return &tx, txbuf, pver, blksha, height, txspent, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
// FetchTxAllBySha returns several pieces of data regarding the given sha.
|
// FetchTxBySha 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) {
|
func (db *SqliteDb) FetchTxBySha(txsha *btcwire.ShaHash) (rtx *btcwire.MsgTx, rpver uint32, rblksha *btcwire.ShaHash, err error) {
|
||||||
var pver uint32
|
var pver uint32
|
||||||
var blksha *btcwire.ShaHash
|
var blksha *btcwire.ShaHash
|
||||||
var height int64
|
var height int64
|
||||||
@ -240,7 +240,7 @@ func (db *SqliteDb) FetchTxAllBySha(txsha *btcwire.ShaHash) (rtx *btcwire.MsgTx,
|
|||||||
|
|
||||||
// Check Tx cache
|
// Check Tx cache
|
||||||
if txc, ok := db.fetchTxCache(txsha); ok {
|
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
|
// If not cached load it
|
||||||
@ -293,20 +293,7 @@ func (db *SqliteDb) FetchTxAllBySha(txsha *btcwire.ShaHash) (rtx *btcwire.MsgTx,
|
|||||||
txc.blksha = *blksha
|
txc.blksha = *blksha
|
||||||
db.insertTxCache(&txc)
|
db.insertTxCache(&txc)
|
||||||
|
|
||||||
return &tx, txbuf, pver, blksha, nil
|
return &tx, 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
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// fetchTxCache look up the given transaction in the Tx cache.
|
// fetchTxCache look up the given transaction in the Tx cache.
|
||||||
|
@ -11,14 +11,6 @@ import (
|
|||||||
_ "github.com/mattn/go-sqlite3"
|
_ "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.
|
// insertTx inserts a tx hash and its associated data into the database.
|
||||||
// Must be called with db lock held.
|
// Must be called with db lock held.
|
||||||
func (db *SqliteDb) insertTx(txsha *btcwire.ShaHash, height int64, txoff int, txlen int, usedbuf []byte) (err error) {
|
func (db *SqliteDb) insertTx(txsha *btcwire.ShaHash, height int64, txoff int, txlen int, usedbuf []byte) (err error) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user