Closed flomang closed 2 years ago
Okay, this seems all fine, just one small change noted above. This affects the core crate, but the new functions aren't called from anywhere else, just used by the grin-gui project.
Yes, these functions are only really needed for the gui atm. I was thinking maybe a feature?
Yes, these functions are only really needed for the gui atm. I was thinking maybe a feature?
Think we're fine as is, no need to complicate with features since there are no downsides to including this.
The grin-gui needs to be able to start the embedded node either in Testnet or Mainnet. If the user selects a Testnet wallet while the embedded node is running on Mainnet the grin-gui shall shutdown the Mainnet node and restart a Testnet node. Unfortunately, since the initglobal... calls need to be called again with different parameters (i.e. change chain_type, fee, etc) the OneTime panics.
These functions shall permit the globals to be set again so the grin-gui can dynamically change its global context for Mainnet or Testnet.