diff --git a/cmd/utils/cmd.go b/cmd/utils/cmd.go index c2dcbf2951..394e1e4e5c 100644 --- a/cmd/utils/cmd.go +++ b/cmd/utils/cmd.go @@ -124,7 +124,7 @@ func makeFullNode(p2p quai.NetworkingAPI, nodeLocation common.Location, slicesRu backend, _ := RegisterQuaiService(stack, p2p, cfg.Quai, cfg.Node.NodeLocation.Context(), currentExpansionNumber, startingExpansionNumber, genesisBlock, logger) sendfullstats := viper.GetBool(SendFullStatsFlag.Name) // Add the Quai Stats daemon if requested. - if cfg.Quaistats.URL != "" { + if cfg.Quaistats.URL != "" && backend.ProcessingState() { RegisterQuaiStatsService(stack, backend, cfg.Quaistats.URL, sendfullstats) } return stack, backend diff --git a/core/slice.go b/core/slice.go index 8f69cc566c..3df0e620a1 100644 --- a/core/slice.go +++ b/core/slice.go @@ -424,6 +424,8 @@ func (sl *Slice) Append(header *types.WorkObject, domPendingHeader *types.WorkOb // Relay the new pendingHeader sl.relayPh(block, pendingHeaderWithTermini, domOrigin, block.Location(), subReorg) + inputs, outputs := block.InputsAndOutputsWithoutCoinbase() + net := int(outputs) - int(inputs) time10 := common.PrettyDuration(time.Since(start)) sl.logger.WithFields(log.Fields{ "t0_1": time0_1, @@ -447,23 +449,24 @@ func (sl *Slice) Append(header *types.WorkObject, domPendingHeader *types.WorkOb }).Info("Times during sub append") sl.logger.WithFields(log.Fields{ - "number": block.NumberArray(), - "hash": block.Hash(), - "difficulty": block.Difficulty(), - "uncles": len(block.Uncles()), - "totalTxs": len(block.Transactions()), - "etxs emitted": len(block.ExtTransactions()), - "qiTxs": len(block.QiTransactions()), - "quaiTxs": len(block.QuaiTransactions()), - "etxs inbound": len(block.Body().ExternalTransactions()), - "gas": block.GasUsed(), - "gasLimit": block.GasLimit(), - "evmRoot": block.EVMRoot(), - "utxoRoot": block.UTXORoot(), - "etxSetRoot": block.EtxSetRoot(), - "order": order, - "location": block.Location(), - "elapsed": common.PrettyDuration(time.Since(start)), + "number": block.NumberArray(), + "hash": block.Hash(), + "difficulty": block.Difficulty(), + "uncles": len(block.Uncles()), + "totalTxs": len(block.Transactions()), + "etxs emitted": len(block.ExtTransactions()), + "qiTxs": len(block.QiTransactions()), + "net outputs-inputs": net, + "quaiTxs": len(block.QuaiTransactions()), + "etxs inbound": len(block.Body().ExternalTransactions()), + "gas": block.GasUsed(), + "gasLimit": block.GasLimit(), + "evmRoot": block.EVMRoot(), + "utxoRoot": block.UTXORoot(), + "etxSetRoot": block.EtxSetRoot(), + "order": order, + "location": block.Location(), + "elapsed": common.PrettyDuration(time.Since(start)), }).Info("Appended new block") if nodeCtx == common.ZONE_CTX { diff --git a/core/types/wo.go b/core/types/wo.go index 31d8154d99..61a2aa98e3 100644 --- a/core/types/wo.go +++ b/core/types/wo.go @@ -345,6 +345,22 @@ func (wo *WorkObject) QuaiTransactionsWithoutCoinbase() []*Transaction { return quaiTxs } +func (wo *WorkObject) InputsAndOutputsWithoutCoinbase() (uint, uint) { + inputs := 0 + outputs := 0 + for i, tx := range wo.Transactions() { + if i == 0 && IsCoinBaseTx(tx, wo.woHeader.parentHash, wo.woHeader.location) { + // ignore the Qi coinbase tx + continue + } + if tx.Type() == QiTxType { + inputs += len(tx.TxIn()) + outputs += len(tx.TxOut()) + } + } + return uint(inputs), uint(outputs) +} + func (wo *WorkObject) QuaiTransactionsWithFees() []*Transaction { quaiTxs := make([]*Transaction, 0) for _, t := range wo.Transactions() {