Skip to content

Commit 48f11d9

Browse files
authored
fix(block): return errors in publishBlock where previously nil was returned (#1637)
<!-- Please read and fill out this form before submitting your PR. Please make sure you have reviewed our contributors guide before submitting your first PR. NOTE: PR titles should follow semantic commits: https://www.conventionalcommits.org/en/v1.0.0/ --> ## Overview <!-- Please provide an explanation of the PR, including the appropriate context, background, goal, and rationale. If there is an issue with this information, please provide a tl;dr and link the issue. Ex: Closes #<issue number> --> Discussed during onsite <!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## Summary by CodeRabbit - **Bug Fixes** - Improved error handling in the block publishing process to ensure errors are properly reported and not suppressed. <!-- end of auto-generated comment: release notes by coderabbit.ai -->
1 parent dca02cf commit 48f11d9

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

block/manager.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -758,7 +758,7 @@ func (m *Manager) publishBlock(ctx context.Context) error {
758758
m.logger.Info("Creating and publishing block", "height", newHeight)
759759
block, err = m.createBlock(newHeight, lastCommit, lastHeaderHash)
760760
if err != nil {
761-
return nil
761+
return err
762762
}
763763
m.logger.Debug("block info", "num_tx", len(block.Data.Txs))
764764

@@ -772,7 +772,7 @@ func (m *Manager) publishBlock(ctx context.Context) error {
772772
*/
773773
block.SignedHeader.DataHash, err = block.Data.Hash()
774774
if err != nil {
775-
return nil
775+
return err
776776
}
777777

778778
commit, err = m.getCommit(block.SignedHeader.Header)

0 commit comments

Comments
 (0)