Export the CheckTransactionSanity function.

This commit is contained in:
Dave Collins 2013-09-30 16:43:10 -05:00
parent 6695cd15bb
commit e576962cb3

View file

@ -173,9 +173,9 @@ func calcBlockSubsidy(height int64) int64 {
return baseSubsidy >> uint(height/subsidyHalvingInterval) return baseSubsidy >> uint(height/subsidyHalvingInterval)
} }
// checkTransactionSanity performs some preliminary checks on a transaction to // CheckTransactionSanity performs some preliminary checks on a transaction to
// ensure it is sane. These checks are context free. // ensure it is sane. These checks are context free.
func checkTransactionSanity(tx *btcwire.MsgTx) error { func CheckTransactionSanity(tx *btcwire.MsgTx) error {
// A transaction must have at least one input. // A transaction must have at least one input.
if len(tx.TxIn) == 0 { if len(tx.TxIn) == 0 {
return RuleError("transaction has no inputs") return RuleError("transaction has no inputs")
@ -437,7 +437,7 @@ func (b *BlockChain) checkBlockSanity(block *btcutil.Block) error {
// Do some preliminary checks on each transaction to ensure they are // Do some preliminary checks on each transaction to ensure they are
// sane before continuing. // sane before continuing.
for _, tx := range transactions { for _, tx := range transactions {
err := checkTransactionSanity(tx) err := CheckTransactionSanity(tx)
if err != nil { if err != nil {
return err return err
} }