Noticed that the /activations code was pretty messy, wanted to clean it up a bit:
Use sync.Once instead of a bool to calculate network name
Don't export structs not used or needed outside of package
Add unit test that double check all the defaults
I discovered a bug where for networks that don't have a custom entry and the default is "disabled", it would always enable them on the first block. Essentially it checked for it and printed out "never activating" but returned true anyway. This fixes that, which has no effect on either MainNet or TestNet. It might have an effect on some unit tests that use a custom network, or any custom network out there.
For that reason, I changed the default to 0 (always active) to keep behavior consistent with how it used to work before.
Noticed that the /activations code was pretty messy, wanted to clean it up a bit:
I discovered a bug where for networks that don't have a custom entry and the default is "disabled", it would always enable them on the first block. Essentially it checked for it and printed out "never activating" but returned true anyway. This fixes that, which has no effect on either MainNet or TestNet. It might have an effect on some unit tests that use a custom network, or any custom network out there.
For that reason, I changed the default to 0 (always active) to keep behavior consistent with how it used to work before.