From d72255bce3a0d19e06f7eb809deab6c68b289a9d Mon Sep 17 00:00:00 2001 From: "Owain G. Ainsworth" Date: Tue, 17 Dec 2013 14:02:35 +0000 Subject: [PATCH] gofmt --- mempool.go | 12 ++++++------ rpcserver.go | 30 ++++++++++++++---------------- 2 files changed, 20 insertions(+), 22 deletions(-) diff --git a/mempool.go b/mempool.go index 5709fba1..d8cbf956 100644 --- a/mempool.go +++ b/mempool.go @@ -82,9 +82,9 @@ const ( // metadata we store about it. type TxDesc struct { Tx *btcutil.Tx // Transaction. - Added time.Time // Time when added to pool. - Height int64 // Blockheight when added to pool. - Fee int64 // Transaction fees. + Added time.Time // Time when added to pool. + Height int64 // Blockheight when added to pool. + Fee int64 // Transaction fees. } // txMemPool is used as a source of transactions that need to be mined into @@ -640,10 +640,10 @@ func (mp *txMemPool) addTransaction(tx *btcutil.Tx, height, fee int64) { // Add the transaction to the pool and mark the referenced outpoints // as spent by the pool. mp.pool[*tx.Sha()] = &TxDesc{ - Tx: tx, - Added: time.Now(), + Tx: tx, + Added: time.Now(), Height: height, - Fee: fee, + Fee: fee, } for _, txIn := range tx.MsgTx().TxIn { mp.outpoints[txIn.PreviousOutpoint] = tx diff --git a/rpcserver.go b/rpcserver.go index 92643290..657c348b 100644 --- a/rpcserver.go +++ b/rpcserver.go @@ -871,14 +871,13 @@ func handleGetPeerInfo(s *rpcServer, cmd btcjson.Cmd, walletNotification chan [] } type mempoolDescriptor struct { - Size int `json:"size"` - Fee int64 `json:"fee"` - Time int64 `json:"time"` - Height int64 `json:"height"` - StartingPriority int `json:"startingpriority"` - CurrentPriority int `json:"currentpriority"` - Depends []string `json:"depends"` - + Size int `json:"size"` + Fee int64 `json:"fee"` + Time int64 `json:"time"` + Height int64 `json:"height"` + StartingPriority int `json:"startingpriority"` + CurrentPriority int `json:"currentpriority"` + Depends []string `json:"depends"` } // handleGetRawMempool implements the getrawmempool command. @@ -890,12 +889,12 @@ func handleGetRawMempool(s *rpcServer, cmd btcjson.Cmd, walletNotification chan result := make(map[string]*mempoolDescriptor, len(descs)) for _, desc := range descs { mpd := &mempoolDescriptor{ - Size: desc.Tx.MsgTx().SerializeSize(), - Fee: desc.Fee, - Time: desc.Added.Unix(), - Height: desc.Height, + Size: desc.Tx.MsgTx().SerializeSize(), + Fee: desc.Fee, + Time: desc.Added.Unix(), + Height: desc.Height, StartingPriority: 0, // We don't mine. - CurrentPriority: 0, // We don't mine. + CurrentPriority: 0, // We don't mine. } for _, txIn := range desc.Tx.MsgTx().TxIn { hash := &txIn.PreviousOutpoint.Hash @@ -908,14 +907,13 @@ func handleGetRawMempool(s *rpcServer, cmd btcjson.Cmd, walletNotification chan result[desc.Tx.Sha().String()] = mpd } - return result, nil + return result, nil } hashStrings := make([]string, len(descs)) - for i := range(hashStrings) { + for i := range hashStrings { hashStrings[i] = descs[i].Tx.Sha().String() } - return hashStrings, nil }