Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions blockchain/transaction_execute.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
5 changes: 4 additions & 1 deletion cmd/simulator/simulator.go
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
6 changes: 3 additions & 3 deletions globals/globals.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down