helium / blockchain-core

Apache License 2.0
214 stars 85 forks source link

Fix bug in h3dex targeting lookup call #1442

Closed PaulVMo closed 1 year ago

PaulVMo commented 1 year ago

Fixes a bug in the call to build_random_hex_targeting_lookup when adding or removing hexes from the h3dex.

Vagabond commented 1 year ago

How did this ever work and is fixing it without a var safe?

PaulVMo commented 1 year ago

I do not believe it needs a var. It worked because the only case that was correct was the only one that actually got called. Two cases were protected by a var already, and the third in the remove_gw wasn't ever called because the parent hex is checked to see if it is populated BEFORE the gateway's hex is actually removed from the h3dex - meaning it will always be populated and never trigger a rebuild.

On Thu, Jul 28, 2022 at 8:27 AM Andrew Thompson @.***> wrote:

How did this ever work and is fixing it without a var safe?

— Reply to this email directly, view it on GitHub https://github.com/helium/blockchain-core/pull/1442#issuecomment-1198140409, or unsubscribe https://github.com/notifications/unsubscribe-auth/ABLJDYIYH3ADPXI5IUXIFHTVWKDCHANCNFSM543K5D2Q . You are receiving this because you authored the thread.Message ID: @.***>