SaveSeenCommit saves a seen commit, used by e.g. the state sync reactor when bootstrapping node.
(height int64, seenCommit *types.Commit)
| 417 | |
| 418 | // SaveSeenCommit saves a seen commit, used by e.g. the state sync reactor when bootstrapping node. |
| 419 | func (bs *BlockStore) SaveSeenCommit(height int64, seenCommit *types.Commit) error { |
| 420 | pbc := seenCommit.ToProto() |
| 421 | seenCommitBytes, err := proto.Marshal(pbc) |
| 422 | if err != nil { |
| 423 | return fmt.Errorf("unable to marshal commit: %w", err) |
| 424 | } |
| 425 | return bs.db.Set(calcSeenCommitKey(height), seenCommitBytes) |
| 426 | } |
| 427 | |
| 428 | func (bs *BlockStore) Close() error { |
| 429 | return bs.db.Close() |
no test coverage detected