From ea9ce4e0b1504fabf4b234b883a4d2037007c100 Mon Sep 17 00:00:00 2001 From: Josh Rickmar Date: Mon, 7 Oct 2013 13:25:05 -0400 Subject: [PATCH] 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. --- cmdmgr.go | 6 +++--- config.go | 2 +- sockets.go | 6 +++--- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/cmdmgr.go b/cmdmgr.go index a60e74c..4ca1ae0 100644 --- a/cmdmgr.go +++ b/cmdmgr.go @@ -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 { diff --git a/config.go b/config.go index df10f48..7b2e4aa 100644 --- a/config.go +++ b/config.go @@ -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. diff --git a/sockets.go b/sockets.go index d737825..ddccebf 100644 --- a/sockets.go +++ b/sockets.go @@ -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