This commit is contained in:
Dave Collins 2013-11-21 09:48:57 -06:00
parent 3bc401fed1
commit fc11da9ca0
4 changed files with 28 additions and 31 deletions

View file

@ -5,7 +5,7 @@
package ldb
import (
//"fmt"
//"fmt"
)
// InvalidateTxCache clear/release all cached transactions.

View file

@ -75,7 +75,6 @@ out:
}
}
newheight, err := db.InsertBlock(block)
if err != nil {
t.Errorf("failed to insert block %v err %v", height, err)

View file

@ -501,13 +501,13 @@ func (db *LevelDb) setclearSpentData(txsha *btcwire.ShaHash, idx uint32, set boo
}
// need to reslice the list to exclude the most recent.
sTx := spentTxList [len(spentTxList) -1]
spentTxList [len(spentTxList) -1] = nil
if len (spentTxList) == 1 {
sTx := spentTxList[len(spentTxList)-1]
spentTxList[len(spentTxList)-1] = nil
if len(spentTxList) == 1 {
// write entry to delete tx from spent pool
// XXX
} else {
spentTxList = spentTxList [:len(spentTxList)-1]
spentTxList = spentTxList[:len(spentTxList)-1]
// XXX format sTxList and set update Table
}
@ -551,7 +551,7 @@ func (db *LevelDb) setclearSpentData(txsha *btcwire.ShaHash, idx uint32, set boo
if fullySpent {
var txSu *spentTxUpdate
// Look up Tx in fully spent table
if txSuOld, ok := db.txSpentUpdateMap[*txsha] ; ok {
if txSuOld, ok := db.txSpentUpdateMap[*txsha]; ok {
txSu = txSuOld
} else {
var txSuStore spentTxUpdate

View file

@ -9,8 +9,8 @@ import (
"encoding/binary"
"fmt"
"github.com/conformal/btcdb"
"github.com/conformal/goleveldb/leveldb"
"github.com/conformal/btcwire"
"github.com/conformal/goleveldb/leveldb"
)
type txUpdateObj struct {
@ -384,8 +384,7 @@ func (db *LevelDb) FetchTxBySha(txsha *btcwire.ShaHash) ([]*btcdb.TxListReply, e
replylen += len(sTxList)
}
replies := make ([]*btcdb.TxListReply, replylen)
replies := make([]*btcdb.TxListReply, replylen)
if fSerr == nil {
for _, stx := range sTxList {
@ -419,4 +418,3 @@ func (db *LevelDb) FetchTxBySha(txsha *btcwire.ShaHash) ([]*btcdb.TxListReply, e
}
return replies, nil
}