Export the CheckBlockSanity function.
This commit is contained in:
parent
36941cc427
commit
09b53a8fca
4 changed files with 4 additions and 10 deletions
|
@ -16,12 +16,6 @@ import (
|
|||
"time"
|
||||
)
|
||||
|
||||
// TstCheckBlockSanity makes the internal checkBlockSanity function available to
|
||||
// the test package.
|
||||
func (b *BlockChain) TstCheckBlockSanity(block *btcutil.Block) error {
|
||||
return b.checkBlockSanity(block)
|
||||
}
|
||||
|
||||
// TstSetCoinbaseMaturity makes the ability to set the coinbase maturity
|
||||
// available to the test package.
|
||||
func TstSetCoinbaseMaturity(maturity int64) {
|
||||
|
|
|
@ -112,7 +112,7 @@ func (b *BlockChain) ProcessBlock(block *btcutil.Block) error {
|
|||
}
|
||||
|
||||
// Perform preliminary sanity checks on the block and its transactions.
|
||||
err = b.checkBlockSanity(block)
|
||||
err = b.CheckBlockSanity(block)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
|
|
@ -388,9 +388,9 @@ func countP2SHSigOps(tx *btcutil.Tx, isCoinBaseTx bool, txStore TxStore) (int, e
|
|||
return totalSigOps, nil
|
||||
}
|
||||
|
||||
// checkBlockSanity performs some preliminary checks on a block to ensure it is
|
||||
// CheckBlockSanity performs some preliminary checks on a block to ensure it is
|
||||
// sane before continuing with block processing. These checks are context free.
|
||||
func (b *BlockChain) checkBlockSanity(block *btcutil.Block) error {
|
||||
func (b *BlockChain) CheckBlockSanity(block *btcutil.Block) error {
|
||||
// NOTE: bitcoind does size limits checking here, but the size limits
|
||||
// have already been checked by btcwire for incoming blocks. Also,
|
||||
// btcwire checks the size limits on send too, so there is no need
|
||||
|
|
|
@ -24,7 +24,7 @@ func TestCheckBlockSanity(t *testing.T) {
|
|||
defer teardownFunc()
|
||||
|
||||
block := btcutil.NewBlock(&Block100000)
|
||||
err = chain.TstCheckBlockSanity(block)
|
||||
err = chain.CheckBlockSanity(block)
|
||||
if err != nil {
|
||||
t.Errorf("CheckBlockSanity: %v", err)
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue