Gofmt.
This commit is contained in:
parent
3bc401fed1
commit
fc11da9ca0
4 changed files with 28 additions and 31 deletions
|
@ -5,7 +5,7 @@
|
||||||
package ldb
|
package ldb
|
||||||
|
|
||||||
import (
|
import (
|
||||||
//"fmt"
|
//"fmt"
|
||||||
)
|
)
|
||||||
|
|
||||||
// InvalidateTxCache clear/release all cached transactions.
|
// InvalidateTxCache clear/release all cached transactions.
|
||||||
|
|
|
@ -75,7 +75,6 @@ out:
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
newheight, err := db.InsertBlock(block)
|
newheight, err := db.InsertBlock(block)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
t.Errorf("failed to insert block %v err %v", height, err)
|
t.Errorf("failed to insert block %v err %v", height, err)
|
||||||
|
|
|
@ -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.
|
// need to reslice the list to exclude the most recent.
|
||||||
sTx := spentTxList [len(spentTxList) -1]
|
sTx := spentTxList[len(spentTxList)-1]
|
||||||
spentTxList [len(spentTxList) -1] = nil
|
spentTxList[len(spentTxList)-1] = nil
|
||||||
if len (spentTxList) == 1 {
|
if len(spentTxList) == 1 {
|
||||||
// write entry to delete tx from spent pool
|
// write entry to delete tx from spent pool
|
||||||
// XXX
|
// XXX
|
||||||
} else {
|
} else {
|
||||||
spentTxList = spentTxList [:len(spentTxList)-1]
|
spentTxList = spentTxList[:len(spentTxList)-1]
|
||||||
// XXX format sTxList and set update Table
|
// XXX format sTxList and set update Table
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -551,7 +551,7 @@ func (db *LevelDb) setclearSpentData(txsha *btcwire.ShaHash, idx uint32, set boo
|
||||||
if fullySpent {
|
if fullySpent {
|
||||||
var txSu *spentTxUpdate
|
var txSu *spentTxUpdate
|
||||||
// Look up Tx in fully spent table
|
// Look up Tx in fully spent table
|
||||||
if txSuOld, ok := db.txSpentUpdateMap[*txsha] ; ok {
|
if txSuOld, ok := db.txSpentUpdateMap[*txsha]; ok {
|
||||||
txSu = txSuOld
|
txSu = txSuOld
|
||||||
} else {
|
} else {
|
||||||
var txSuStore spentTxUpdate
|
var txSuStore spentTxUpdate
|
||||||
|
|
|
@ -9,8 +9,8 @@ import (
|
||||||
"encoding/binary"
|
"encoding/binary"
|
||||||
"fmt"
|
"fmt"
|
||||||
"github.com/conformal/btcdb"
|
"github.com/conformal/btcdb"
|
||||||
"github.com/conformal/goleveldb/leveldb"
|
|
||||||
"github.com/conformal/btcwire"
|
"github.com/conformal/btcwire"
|
||||||
|
"github.com/conformal/goleveldb/leveldb"
|
||||||
)
|
)
|
||||||
|
|
||||||
type txUpdateObj struct {
|
type txUpdateObj struct {
|
||||||
|
@ -384,8 +384,7 @@ func (db *LevelDb) FetchTxBySha(txsha *btcwire.ShaHash) ([]*btcdb.TxListReply, e
|
||||||
replylen += len(sTxList)
|
replylen += len(sTxList)
|
||||||
}
|
}
|
||||||
|
|
||||||
replies := make ([]*btcdb.TxListReply, replylen)
|
replies := make([]*btcdb.TxListReply, replylen)
|
||||||
|
|
||||||
|
|
||||||
if fSerr == nil {
|
if fSerr == nil {
|
||||||
for _, stx := range sTxList {
|
for _, stx := range sTxList {
|
||||||
|
@ -419,4 +418,3 @@ func (db *LevelDb) FetchTxBySha(txsha *btcwire.ShaHash) ([]*btcdb.TxListReply, e
|
||||||
}
|
}
|
||||||
return replies, nil
|
return replies, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue