github.com/NebulousLabs/Sia@v1.3.7/modules/consensus/consistency_helpers_test.go (about)

     1  package consensus
     2  
     3  import (
     4  	"github.com/NebulousLabs/Sia/crypto"
     5  
     6  	"github.com/coreos/bbolt"
     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  }