Skip to content

Commit

Permalink
Revert print log
Browse files Browse the repository at this point in the history
  • Loading branch information
laizy committed Jul 4, 2018
1 parent 00325d4 commit 3249f26
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 19 deletions.
6 changes: 1 addition & 5 deletions core/store/ChainStore/ChainStore.go
Original file line number Diff line number Diff line change
Expand Up @@ -311,10 +311,8 @@ func (bd *ChainStore) IsTxHashDuplicate(txhash Uint256) bool {
prefix := []byte{byte(DATA_Transaction)}
_, err_get := bd.st.Get(append(prefix, txhash.ToArray()...))
if err_get != nil {
log.Infof("[IsTxHashDuplicate] NRF tx=%x",txhash)
return false
} else {
log.Infof("[IsTxHashDuplicate] FND tx=%x",txhash)
return true
}
}
Expand Down Expand Up @@ -569,7 +567,7 @@ func (bd *ChainStore) SaveTransaction(tx *tx.Transaction, height uint32) error {
// get transaction hash
txHashValue := tx.Hash()
txHashValue.Serialize(txhash)
log.Info(fmt.Sprintf("[SaveTransaction] transaction header + hash: %x", txhash))
log.Debug(fmt.Sprintf("transaction header + hash: %x\n", txhash))

// generate value
w := bytes.NewBuffer(nil)
Expand Down Expand Up @@ -1163,8 +1161,6 @@ func (self *ChainStore) handlePersistBlockTask(b *Block, ledger *Ledger) {
if err != nil {
log.Error("failed to persist header hash list:", err)
return
}else{
log.Infof("[handlePersistBlockTask] block %d persist completed.",b.Blockdata.Height)
}
self.mu.Lock()
self.storedHeaderCount = storedHeaderCount
Expand Down
16 changes: 2 additions & 14 deletions net/node/transactionPool.go
Original file line number Diff line number Diff line change
Expand Up @@ -35,11 +35,11 @@ func (this *TXNPool) init() {
func (this *TXNPool) AppendTxnPool(txn *transaction.Transaction) ErrCode {
//verify transaction with Concurrency
if errCode := va.VerifyTransaction(txn); errCode != ErrNoError {
log.Infof("Transaction tx=%x verification failed", txn.Hash())
log.Info("Transaction verification failed", txn.Hash())
return errCode
}
if errCode := va.VerifyTransactionWithLedger(txn, ledger.DefaultLedger); errCode != ErrNoError {
log.Infof("Transaction tx=%x verification with ledger failed", txn.Hash())
log.Info("Transaction verification with ledger failed", txn.Hash())
return errCode
}
//verify transaction by pool with lock
Expand Down Expand Up @@ -203,23 +203,12 @@ func (this *TXNPool) cleanTransactionList(txns []*transaction.Transaction) error
cleaned := 0
txnsNum := len(txns)
for _, txn := range txns {
if exist := ledger.DefaultLedger.Store.IsTxHashDuplicate(txn.Hash()); exist == false {
log.Warnf("[cleanTransactionList] transaction %x not in db before clean.", txn.Hash())
}

if txn.TxType == transaction.BookKeeping {
txnsNum = txnsNum - 1
continue
}
if this.deltxnList(txn) {
cleaned++
} else {
log.Infof("txn=%x not cleaned", txn.Hash())
this.Lock()
for _, v := range this.txnList {
log.Infof("v.Hash()=%x", v.Hash())
}
this.Unlock()
}
}
if txnsNum != cleaned {
Expand All @@ -236,7 +225,6 @@ func (this *TXNPool) addtxnList(txn *transaction.Transaction) bool {
if _, ok := this.txnList[txnHash]; ok {
return false
}
log.Infof("[addtxnList] addtxnList txn hash=%x", txnHash)
this.txnList[txnHash] = txn
return true
}
Expand Down

0 comments on commit 3249f26

Please sign in to comment.