remove unnecessary fields from query results
@@ -836,9 +836,6 @@ func (l *Ledger) query() {
type response struct {
vote finalizationVote
-
- cacheValid bool
- cacheBlock *Block
}
responseChan := make(chan response)
@@ -860,7 +857,7 @@ func (l *Ledger) query() {
req.CacheBlockId = make([]byte, SizeBlockID)
copy(req.CacheBlockId, cached.ID[:])
- response.cacheBlock = cached
+ response.vote.block = cached
}
f := func() {
@@ -896,7 +893,6 @@ func (l *Ledger) query() {
response.vote.voter = voter
if res.CacheValid {
- response.cacheValid = true
return
}
@@ -933,9 +929,7 @@ func (l *Ledger) query() {
voters[response.vote.voter.PublicKey()] = struct{}{}
- if response.cacheValid {
- response.vote.block = response.cacheBlock
- } else if response.vote.block != nil {
+ if response.vote.block != nil {
l.queryPeerBlockCache.Put(response.vote.voter.Checksum(), response.vote.block)
}
