gitlab.com/SiaPrime/SiaPrime@v1.4.1/modules/consensus/consistency_helpers_test.go (about) 1 package consensus 2 3 import ( 4 bolt "github.com/coreos/bbolt" 5 6 "gitlab.com/SiaPrime/SiaPrime/crypto" 7 ) 8 9 // dbConsensusChecksum is a convenience function to call consensusChecksum 10 // without a bolt.Tx. 11 func (cs *ConsensusSet) dbConsensusChecksum() (checksum crypto.Hash) { 12 err := cs.db.Update(func(tx *bolt.Tx) error { 13 checksum = consensusChecksum(tx) 14 return nil 15 }) 16 if err != nil { 17 panic(err) 18 } 19 return checksum 20 }