diff --git a/blockchain/transaction_execute.go b/blockchain/transaction_execute.go index 2a3bb7b4..8f2349b8 100644 --- a/blockchain/transaction_execute.go +++ b/blockchain/transaction_execute.go @@ -182,8 +182,8 @@ func (chain *Blockchain) process_transaction(changed map[crypto.Hash]*graviton.T zerobalance := crypto.ConstructElGamal(acckey.G1(), crypto.ElGamal_BASE_G) - if !globals.IsMainnet() { // give testnet users a dummy amount to play - zerobalance = zerobalance.Plus(new(big.Int).SetUint64(800000)) // add fix amount to every wallet to users balance for more testing + if !globals.IsMainnet() || chain.simulator { // give testnet users a dummy amount to play + zerobalance = zerobalance.Plus(new(big.Int).SetUint64(100000000)) // add fix amount to every wallet to users balance for more testing } // give new wallets generated in initial month a balance diff --git a/cmd/simulator/simulator.go b/cmd/simulator/simulator.go index 607fe2a0..5bfefbdf 100644 --- a/cmd/simulator/simulator.go +++ b/cmd/simulator/simulator.go @@ -132,7 +132,10 @@ func main() { rpcport = globals.Arguments["--rpc-bind"].(string) } globals.Arguments["--rpc-bind"] = rpcport - globals.Arguments["--testnet"] = true + // Only set --testnet if user explicitly provided it, otherwise default to mainnet + if globals.Arguments["--testnet"] == nil { + globals.Arguments["--testnet"] = false + } globals.Arguments["--simulator"] = true globals.Arguments["--daemon-address"] = rpcport // feed it for wallets diff --git a/globals/globals.go b/globals/globals.go index be27158c..85a8cfc3 100644 --- a/globals/globals.go +++ b/globals/globals.go @@ -102,11 +102,11 @@ var Dialer proxy.Dialer = proxy.Direct // for proxy and direct connections var Arguments = map[string]interface{}{} func InitNetwork() { - Config = config.Mainnet // default is mainnnet - if Arguments["--testnet"].(bool) == true { // setup testnet if requested + Config = config.Mainnet // default is mainnet + // Handle nil case: if --testnet not provided, defaults to mainnet + if testnet, ok := Arguments["--testnet"].(bool); ok && testnet { Config = config.Testnet } - } // these 2 global variables control all log levels