Commit 5e2e2af4 authored by David Stainton's avatar David Stainton

Merge remote-tracking branch 'origin/fix_nil_consensus'

parents d156fc57 2d8848ca
......@@ -443,7 +443,10 @@ func (s *state) documentForEpoch(epoch uint64) ([]byte, error) {
// If we have a serialized document, return it.
if d, ok := s.documents[epoch]; ok {
return d.raw, nil
if d.raw != nil {
return d.raw, nil
return nil, fmt.Errorf("nil document for epoch %d", epoch)
// Otherwise, return an error based on the time.
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment