Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

blockchain: Remove unused CheckWorklessBlockSanity. #1496

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 0 additions & 7 deletions blockchain/validate.go
Original file line number Diff line number Diff line change
Expand Up @@ -902,13 +902,6 @@ func CheckBlockSanity(block *dcrutil.Block, timeSource MedianTimeSource, chainPa
return checkBlockSanity(block, timeSource, BFNone, chainParams)
}

// CheckWorklessBlockSanity performs some preliminary checks on a block to
// ensure it is sane before continuing with block processing. These checks are
// context free.
func CheckWorklessBlockSanity(block *dcrutil.Block, timeSource MedianTimeSource, chainParams *chaincfg.Params) error {
return checkBlockSanity(block, timeSource, BFNoPoWCheck, chainParams)
}

// checkBlockHeaderContext peforms several validation checks on the block
// header which depend on its position within the block chain.
//
Expand Down
12 changes: 0 additions & 12 deletions blockchain/validate_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -240,18 +240,6 @@ func TestCheckBlockSanity(t *testing.T) {
}
}

// TestCheckWorklessBlockSanity tests the context free workless block sanity
// checks with blocks not on a chain.
func TestCheckWorklessBlockSanity(t *testing.T) {
params := &chaincfg.RegNetParams
timeSource := NewMedianTime()
block := dcrutil.NewBlock(&badBlock)
err := CheckWorklessBlockSanity(block, timeSource, params)
if err == nil {
t.Fatalf("block should fail.\n")
}
}

// TestCheckBlockHeaderContext tests that genesis block passes context headers
// because its parent is nil.
func TestCheckBlockHeaderContext(t *testing.T) {
Expand Down