Default to testnet.

Use on mainnet is not recommended until extensive testing has been
done, and should be done at your own risk. Run btcwallet with
--mainnet to operate on main Bitcoin network.
This commit is contained in:
Josh Rickmar 2013-10-07 13:25:05 -04:00
parent 3c4ff4b0f4
commit ea9ce4e0b1
3 changed files with 7 additions and 7 deletions

View file

@ -614,10 +614,10 @@ func CreateEncryptedWallet(reply chan []byte, msg *btcjson.Message) {
wallets.RUnlock()
var net btcwire.BitcoinNet
if cfg.TestNet3 {
net = btcwire.TestNet3
} else {
if cfg.MainNet {
net = btcwire.MainNet
} else {
net = btcwire.TestNet3
}
w, err := wallet.NewWallet(wname, desc, []byte(pass), net)
if err != nil {

View file

@ -45,7 +45,7 @@ type config struct {
DataDir string `short:"D" long:"datadir" description:"Directory to store wallets and transactions"`
Username string `short:"u" long:"username" description:"Username for btcd authorization"`
Password string `short:"P" long:"password" description:"Password for btcd authorization"`
TestNet3 bool `long:"testnet" description:"Use the test network"`
MainNet bool `long:"mainnet" description:"Use the main Bitcoin network (default testnet3)"`
}
// btcwalletHomeDir returns an OS appropriate home directory for btcwallet.

View file

@ -485,10 +485,10 @@ func BtcdHandshake(ws *websocket.Conn) {
}
var walletNetwork btcwire.BitcoinNet
if cfg.TestNet3 {
walletNetwork = btcwire.TestNet3
} else {
if cfg.MainNet {
walletNetwork = btcwire.MainNet
} else {
walletNetwork = btcwire.TestNet3
}
correctNetwork <- btcwire.BitcoinNet(fnet) == walletNetwork