Exunge debug code.

This commit is contained in:
Dale Rahn 2013-07-18 18:19:57 -04:00
parent 66731c1a1e
commit bee05db603
3 changed files with 0 additions and 22 deletions

View file

@ -5,17 +5,12 @@
package sqlite3_test package sqlite3_test
import ( import (
//"compress/bzip2"
//"encoding/binary"
"github.com/conformal/btcdb" "github.com/conformal/btcdb"
"github.com/conformal/btcdb/sqlite3" "github.com/conformal/btcdb/sqlite3"
"github.com/conformal/btcutil" "github.com/conformal/btcutil"
"github.com/conformal/btcwire" "github.com/conformal/btcwire"
//"io"
"fmt"
"os" "os"
"path/filepath" "path/filepath"
//"strings"
"testing" "testing"
) )
@ -149,7 +144,6 @@ endtest:
for _, spend := range txInList { for _, spend := range txInList {
itxe := txlookupmap[spend.Hash] itxe := txlookupmap[spend.Hash]
if itxe.TxSpent[spend.Index] == false { if itxe.TxSpent[spend.Index] == false {
fmt.Printf("?? txin %v:%v is unspent %v\n", spend.Hash, spend.Index, itxe.TxSpent)
t.Errorf("txin %v:%v is unspent %v", spend.Hash, spend.Index, itxe.TxSpent) t.Errorf("txin %v:%v is unspent %v", spend.Hash, spend.Index, itxe.TxSpent)
} }
} }
@ -188,7 +182,6 @@ endtest:
for _, spend := range txInList { for _, spend := range txInList {
itxe := txlookupmap[spend.Hash] itxe := txlookupmap[spend.Hash]
if itxe.TxSpent[spend.Index] == true { if itxe.TxSpent[spend.Index] == true {
fmt.Printf("?? txin %v:%v is spent %v\n", spend.Hash, spend.Index, itxe.TxSpent)
t.Errorf("txin %v:%v is unspent %v", spend.Hash, spend.Index, itxe.TxSpent) t.Errorf("txin %v:%v is unspent %v", spend.Hash, spend.Index, itxe.TxSpent)
} }
} }
@ -209,7 +202,6 @@ endtest:
for _, spend := range txInList { for _, spend := range txInList {
itxe := txlookupmap[spend.Hash] itxe := txlookupmap[spend.Hash]
if itxe.TxSpent[spend.Index] == false { if itxe.TxSpent[spend.Index] == false {
fmt.Printf("?? txin %v:%v is unspent %v\n", spend.Hash, spend.Index, itxe.TxSpent)
t.Errorf("txin %v:%v is unspent %v", spend.Hash, spend.Index, itxe.TxSpent) t.Errorf("txin %v:%v is unspent %v", spend.Hash, spend.Index, itxe.TxSpent)
} }
} }

View file

@ -828,11 +828,6 @@ func (db *SqliteDb) setclearSpentData(txsha *btcwire.ShaHash, idx uint32, set bo
byteidx := idx / 8 byteidx := idx / 8
byteoff := idx % 8 byteoff := idx % 8
interestingsha := txsha.String() == "866504b0d6242c237e484b49c6a5db1c234e9a1547e96b7ba3d690cabccbf6b0"
if interestingsha {
fmt.Printf("txdata was %v ", spentdata)
}
if set { if set {
spentdata[byteidx] |= (byte(1) << byteoff) spentdata[byteidx] |= (byte(1) << byteoff)
} else { } else {
@ -842,9 +837,6 @@ func (db *SqliteDb) setclearSpentData(txsha *btcwire.ShaHash, idx uint32, set bo
if cached { if cached {
txc.spent = spentdata txc.spent = spentdata
} }
if interestingsha {
fmt.Printf("now %v\n", spentdata)
}
if usingtmp { if usingtmp {
txop = db.txop(txtmpUpdateUsedByShaStmt) txop = db.txop(txtmpUpdateUsedByShaStmt)

View file

@ -7,7 +7,6 @@ package sqlite3
import ( import (
"bytes" "bytes"
"container/list" "container/list"
"fmt"
"github.com/conformal/btcdb" "github.com/conformal/btcdb"
"github.com/conformal/btcutil" "github.com/conformal/btcutil"
"github.com/conformal/btcwire" "github.com/conformal/btcwire"
@ -141,11 +140,6 @@ func (db *SqliteDb) FetchTxByShaList(txShaList []*btcwire.ShaHash) []*btcdb.TxLi
btxspent[idx] = (txspent[byteidx] & (byte(1) << byteoff)) != 0 btxspent[idx] = (txspent[byteidx] & (byte(1) << byteoff)) != 0
} }
} }
interestingsha := txsha.String() == "866504b0d6242c237e484b49c6a5db1c234e9a1547e96b7ba3d690cabccbf6b"
if interestingsha {
fmt.Printf("usage of sha %v is %v\n", txsha, btxspent)
}
fmt.Printf("usage of sha %v is %v\n", txsha, btxspent)
txlre := btcdb.TxListReply{Sha: txsha, Tx: tx, Height: height, TxSpent: btxspent, Err: err} txlre := btcdb.TxListReply{Sha: txsha, Tx: tx, Height: height, TxSpent: btxspent, Err: err}
replies = append(replies, &txlre) replies = append(replies, &txlre)
} }