providerCounter is an internal variable used to keep track of the providers mapping. Allowing to externally set the value of providerCounter (via the setProviderCounter(...) function) could mess-up the internal state of the providerDB.
For example if due to some mistake the providerCounter is set to a lower value, the next openProvider(...) function call would overwrite some other provider.
I think the setter function for providerCounter should be removed (it is not used anyway).
providerCounter
is an internal variable used to keep track of theproviders
mapping. Allowing to externally set the value ofproviderCounter
(via thesetProviderCounter(...)
function) could mess-up the internal state of theproviderDB
. For example if due to some mistake theproviderCounter
is set to a lower value, the nextopenProvider(...)
function call would overwrite some other provider.I think the setter function for
providerCounter
should be removed (it is not used anyway).