Skip to content

Commit f7a3176

Browse files
authored
Merge pull request #571 from ethpandaops/pk910/fix-docs-and-panics
fix pruning error
2 parents ff11f89 + c92d175 commit f7a3176

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

db/unfinalized_blocks.go

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,10 @@ func InsertUnfinalizedBlock(block *dbtypes.UnfinalizedBlock, tx *sqlx.Tx) error
3232
}
3333

3434
func UpdateUnfinalizedBlockStatus(roots [][]byte, blockStatus dbtypes.UnfinalizedBlockStatus, tx *sqlx.Tx) error {
35+
if len(roots) == 0 {
36+
return nil
37+
}
38+
3539
var sql strings.Builder
3640
args := []any{}
3741

@@ -57,6 +61,10 @@ func UpdateUnfinalizedBlockStatus(roots [][]byte, blockStatus dbtypes.Unfinalize
5761
}
5862

5963
func UpdateUnfinalizedBlockForkId(roots [][]byte, forkId uint64, tx *sqlx.Tx) error {
64+
if len(roots) == 0 {
65+
return nil
66+
}
67+
6068
var sql strings.Builder
6169
args := []any{}
6270

0 commit comments

Comments
 (0)