func (t Transaction) correctFileContracts(currentHeight BlockHeight) error {
	for _, fc := range t.FileContracts {
		if fc.WindowStart <= currentHeight {
			return ErrFileContractWindowStartViolation
		}
		if fc.WindowEnd <= fc.WindowStart {
			return ErrFileContractWindowEndViolation
		}
		var validProofOutputSum, missedProofOutputSum Currency
		for _, output := range fc.ValidProofOutputs {
			validProofOutputSum = validProofOutputSum.Add(output.Value)
		}
		for _, output := range fc.MissedProofOutputs {
			missedProofOutputSum = missedProofOutputSum.Add(output.Value)
		}
		outputPortion := PostTax(currentHeight, fc.Payout)
		if validProofOutputSum.Cmp(outputPortion) != 0 {
			return ErrFileContractOutputSumViolation
		}
		if missedProofOutputSum.Cmp(outputPortion) != 0 {
			return ErrFileContractOutputSumViolation
		}
	}
	return nil
}
correctFileContracts checks that the file contracts adhere to the file
contract rules.
package types
import (
	"errors"
)
var (
	ErrDoubleSpend = errors.New("transaction uses a parent object twice")
	ErrFileContractOutputSumViolation = errors.New("file contract has invalid output sums")
	ErrFileContractWindowEndViolation = errors.New("file contract window must end at least one block after it starts")
	ErrFileContractWindowStartViolation = errors.New("file contract window must start in the future")
	ErrNonZeroClaimStart = errors.New("transaction has a siafund output with a non-zero siafund claim")
	ErrNonZeroRevision = errors.New("new file contract has a nonzero revision number")
	ErrStorageProofWithOutputs = errors.New("transaction has both a storage proof and other outputs")
	ErrTimelockNotSatisfied = errors.New("timelock has not been met")
	ErrTransactionTooLarge = errors.New("transaction is too large to fit in a block")
	ErrZeroMinerFee = errors.New("transaction has a zero value miner fee")
	ErrZeroOutput = errors.New("transaction cannot have an output or payout that has zero value")
	ErrZeroRevision = errors.New("transaction has a file contract revision with RevisionNumber=0")
)