helium / blockchain-core

Apache License 2.0
214 stars 85 forks source link

bugfix for removing gateway from h3dex #1403

Closed PaulVMo closed 2 years ago

PaulVMo commented 2 years ago

When a hex needs to be removed from the h3dex, it may also require rebuilding the targeting lookup for h3dex-based targeting if the parent hex (at the targeting resolution) becomes empty as well. However, due to a bug, this check may not be working as expect leaving the hex in the h3dex. The current code is checking for the count of gateways in the parent hex before removing the gateway from that hex. Instead, it should remove the gateway's hex and then check if that results in the parent hex now being empty.

This change is behind a chain var as to to allow it to be made after h3dex activation.