Fix issues found by golint.

This commit is contained in:
Josh Rickmar 2013-10-15 10:40:23 -04:00
parent 2541ffae76
commit 9b84f87930
3 changed files with 13 additions and 13 deletions

16
cmd.go
View file

@ -215,7 +215,7 @@ func getCurHeight() (height int64) {
return height
}
n := <-NewJsonID
n := <-NewJSONID
m, err := btcjson.CreateMessageWithId("getblockcount",
fmt.Sprintf("btcwallet(%v)", n))
if err != nil {
@ -281,7 +281,7 @@ func (w *BtcWallet) CalculateBalance(confirmations int) float64 {
// each address stored in a wallet and sets up a new reply handler for
// these notifications.
func (w *BtcWallet) Track() {
n := <-NewJsonID
n := <-NewJSONID
w.mtx.Lock()
w.NewBlockTxSeqN = n
w.mtx.Unlock()
@ -302,7 +302,7 @@ func (w *BtcWallet) Track() {
// blocks[0]. If len(blocks) is 2 or greater, the rescan will be
// performed for the block range blocks[0]...blocks[1] (inclusive).
func (w *BtcWallet) RescanForAddress(addr string, blocks ...int) {
n := <-NewJsonID
n := <-NewJSONID
params := []interface{}{addr}
if len(blocks) > 0 {
params = append(params, blocks[0])
@ -481,15 +481,15 @@ func (w *BtcWallet) newBlockTxHandler(result interface{}, e *btcjson.Error) bool
return false
}
// NewJsonID is used to receive the next unique JSON ID for btcd
// NewJSONID is used to receive the next unique JSON ID for btcd
// requests, starting from zero and incrementing by one after each
// read.
var NewJsonID = make(chan uint64)
var NewJSONID = make(chan uint64)
// JsonIDGenerator sends incremental integers across a channel. This
// JSONIDGenerator sends incremental integers across a channel. This
// is meant to provide a unique value for the JSON ID field for btcd
// messages.
func JsonIDGenerator(c chan uint64) {
func JSONIDGenerator(c chan uint64) {
var n uint64
for {
c <- n
@ -528,7 +528,7 @@ func main() {
}()
// Begin generating new IDs for JSON calls.
go JsonIDGenerator(NewJsonID)
go JSONIDGenerator(NewJSONID)
for {
replies := make(chan error)

View file

@ -170,7 +170,7 @@ func ProcessFrontendMsg(reply chan []byte, msg []byte) {
default:
// btcwallet does not understand method. Pass to btcd.
n := <-NewJsonID
n := <-NewJSONID
var id interface{} = fmt.Sprintf("btcwallet(%v)-%v", n,
jsonMsg.Id)
jsonMsg.Id = &id
@ -465,7 +465,7 @@ func SendFrom(reply chan []byte, msg *btcjson.Message) {
}
// Send rawtx off to btcd
n := <-NewJsonID
n := <-NewJSONID
var id interface{} = fmt.Sprintf("btcwallet(%v)", n)
m, err := btcjson.CreateMessageWithId("sendrawtransaction", id,
hex.EncodeToString(rawtx))
@ -609,7 +609,7 @@ func SendMany(reply chan []byte, msg *btcjson.Message) {
}
// Send rawtx off to btcd
n := <-NewJsonID
n := <-NewJSONID
var id interface{} = fmt.Sprintf("btcwallet(%v)", n)
m, err := btcjson.CreateMessageWithId("sendrawtransaction", id,
hex.EncodeToString(rawtx))
@ -764,7 +764,7 @@ func CreateEncryptedWallet(reply chan []byte, msg *btcjson.Message) {
}
// Grab a new unique sequence number for tx notifications in new blocks.
n := <-NewJsonID
n := <-NewJSONID
bw := &BtcWallet{
Wallet: w,
name: wname,

View file

@ -493,7 +493,7 @@ func BtcdConnect(reply chan error) {
// Bitcoin networks). If the sanity checks pass, all wallets are set to
// be tracked against chain notifications from this btcd connection.
func BtcdHandshake(ws *websocket.Conn) {
n := <-NewJsonID
n := <-NewJSONID
msg := btcjson.Message{
Method: "getcurrentnet",
Id: fmt.Sprintf("btcwallet(%v)", n),