From 3249f26076192d5147538ac5407dba3f6b95f9e7 Mon Sep 17 00:00:00 2001 From: laizy Date: Wed, 4 Jul 2018 14:32:53 +0800 Subject: [PATCH] Revert print log --- core/store/ChainStore/ChainStore.go | 6 +----- net/node/transactionPool.go | 16 ++-------------- 2 files changed, 3 insertions(+), 19 deletions(-) diff --git a/core/store/ChainStore/ChainStore.go b/core/store/ChainStore/ChainStore.go index 1f72f139..7fc00587 100644 --- a/core/store/ChainStore/ChainStore.go +++ b/core/store/ChainStore/ChainStore.go @@ -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 } } @@ -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) @@ -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 diff --git a/net/node/transactionPool.go b/net/node/transactionPool.go index d3a141ba..0fe57802 100644 --- a/net/node/transactionPool.go +++ b/net/node/transactionPool.go @@ -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 @@ -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 { @@ -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 }