500 error if there are no su3s
This commit is contained in:
@@ -3,6 +3,7 @@ package reseed
|
||||
import (
|
||||
"crypto/rsa"
|
||||
"crypto/sha256"
|
||||
"errors"
|
||||
"fmt"
|
||||
"hash/crc32"
|
||||
"io/ioutil"
|
||||
@@ -199,6 +200,10 @@ func (rs *ReseederImpl) PeerSu3Bytes(peer Peer) ([]byte, error) {
|
||||
m := <-rs.su3s
|
||||
defer func() { rs.su3s <- m }()
|
||||
|
||||
if 0 == len(m) {
|
||||
return nil, errors.New("404")
|
||||
}
|
||||
|
||||
return m[peer.Hash()%len(m)], nil
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user