fix: only check allocations if they exist

This commit is contained in:
Cassandra Heart 2025-10-07 21:11:45 -05:00
parent baa532640f
commit 8aca6accb2
No known key found for this signature in database
GPG Key ID: 371083BFA6C240AA

View File

@ -418,12 +418,15 @@ func (e *GlobalConsensusEngine) evaluateForProposals(
allocated := false
pending := false
for _, allocation := range self.Allocations {
if bytes.Equal(allocation.ConfirmationFilter, filter) {
allocated = allocation.Status != 4
if e.config.P2P.Network != 0 || data.Frame.Header.FrameNumber > 252840 {
pending = allocation.Status == 0 &&
allocation.JoinFrameNumber+360 <= data.Frame.Header.FrameNumber
if self != nil {
for _, allocation := range self.Allocations {
if bytes.Equal(allocation.ConfirmationFilter, filter) {
allocated = allocation.Status != 4
if e.config.P2P.Network != 0 ||
data.Frame.Header.FrameNumber > 252840 {
pending = allocation.Status == 0 &&
allocation.JoinFrameNumber+360 <= data.Frame.Header.FrameNumber
}
}
}
}