blockchain_go/cli_reindexutxo.go

13 lines
259 B
Go

package main
import "fmt"
func (cli *CLI) reindexUTXO(nodeID string) {
bc := NewBlockchain(nodeID)
UTXOSet := UTXOSet{bc}
UTXOSet.Reindex()
count := UTXOSet.CountTransactions()
fmt.Printf("Done! There are %d transactions in the UTXO set.\n", count)
}