mirror of
https://github.com/nspcc-dev/neo-go.git
synced 2024-11-23 23:30:36 +00:00
1133bbe584
Our mempool only contains valid verified transactions all the time, it never has any unverified ones. Unverified pool made some sense for quick unverifying after the new block acceptance (and gradual background reverification), but reverification needs some non-trivial locking between blockchain and mempool and internal mempool state locking (reverifying tx and moving it between unverified and verified pools must be atomic). But our current reverification is fast enough (and has all the appropriate locks), so bothering with unverified pool makes little sense.
24 lines
460 B
Go
24 lines
460 B
Go
package mempool
|
|
|
|
import "github.com/prometheus/client_golang/prometheus"
|
|
|
|
var (
|
|
//mempoolUnsortedTx prometheus metric.
|
|
mempoolUnsortedTx = prometheus.NewGauge(
|
|
prometheus.GaugeOpts{
|
|
Help: "Mempool Unsorted TXs",
|
|
Name: "mempool_unsorted_tx",
|
|
Namespace: "neogo",
|
|
},
|
|
)
|
|
)
|
|
|
|
func init() {
|
|
prometheus.MustRegister(
|
|
mempoolUnsortedTx,
|
|
)
|
|
}
|
|
|
|
func updateMempoolMetrics(unsortedTxnLen int) {
|
|
mempoolUnsortedTx.Set(float64(unsortedTxnLen))
|
|
}
|