OSDN Git Service

gofmt source
authorYongfeng LI <wliyongfeng@gmail.com>
Sun, 8 Apr 2018 07:44:05 +0000 (15:44 +0800)
committerYongfeng LI <wliyongfeng@gmail.com>
Sun, 8 Apr 2018 07:44:05 +0000 (15:44 +0800)
account/builder.go
api/block_retrieve.go
api/txfeeds.go
netsync/handle.go
netsync/sync.go
wallet/indexer.go

index e3bd7f7..3d1eb82 100755 (executable)
@@ -192,7 +192,7 @@ func (m *Manager) DecodeControlAction(data []byte) (txbuilder.Action, error) {
 type controlAction struct {
        accounts *Manager
        bc.AssetAmount
-       AccountID     string        `json:"account_id"`
+       AccountID string `json:"account_id"`
 }
 
 func (a *controlAction) Build(ctx context.Context, b *txbuilder.TemplateBuilder) error {
index ec5a434..e1ea528 100644 (file)
@@ -4,14 +4,13 @@ import (
        log "github.com/sirupsen/logrus"
 
        "github.com/bytom/blockchain/query"
-       "github.com/bytom/wallet"
        "github.com/bytom/consensus/difficulty"
        chainjson "github.com/bytom/encoding/json"
        "github.com/bytom/protocol/bc"
        "github.com/bytom/protocol/bc/types"
+       "github.com/bytom/wallet"
 )
 
-
 // return best block hash
 func (a *API) getBestBlockHash() Response {
        blockHash := map[string]string{"blockHash": a.chain.BestBlockHash().String()}
@@ -166,4 +165,3 @@ func (a *API) getBlockCount() Response {
        blockHeight := map[string]uint64{"block_count": a.chain.Height()}
        return NewSuccessResponse(blockHeight)
 }
-
index 2786383..9aee2fe 100644 (file)
@@ -6,8 +6,8 @@ import (
 
        log "github.com/sirupsen/logrus"
 
-       "github.com/bytom/errors"
        "github.com/bytom/blockchain/txfeed"
+       "github.com/bytom/errors"
 )
 
 // POST /create-txfeed
index e2b05af..77e2781 100644 (file)
@@ -49,7 +49,7 @@ func NewSyncManager(config *cfg.Config, chain *core.Chain, txPool *core.TxPool,
                quitSync:   make(chan struct{}),
                newBlockCh: newBlockCh,
                newPeerCh:  make(chan struct{}),
-               txSyncCh:    make(chan *txsync),
+               txSyncCh:   make(chan *txsync),
                dropPeerCh: make(chan *string, maxQuitReq),
                peers:      newPeerSet(),
        }
index 223883a..c3c1238 100644 (file)
@@ -17,9 +17,9 @@
 package netsync
 
 import (
+       "math/rand"
        "sync/atomic"
        "time"
-       "math/rand"
 
        log "github.com/sirupsen/logrus"
 
index 8bd8a9f..e1e8938 100755 (executable)
@@ -21,7 +21,7 @@ import (
 )
 
 type rawOutput struct {
-       OutputID       bc.Hash
+       OutputID bc.Hash
        bc.AssetAmount
        ControlProgram []byte
        txHash         bc.Hash
@@ -219,8 +219,7 @@ func (w *Wallet) buildAccountUTXOs(batch db.Batch, b *types.Block, txStatus *bc.
                                continue
                        }
 
-                       if statusFail, _ := txStatus.GetStatus(txIndex);
-                               statusFail && *resOut.Source.Value.AssetId != *consensus.BTMAssetID {
+                       if statusFail, _ := txStatus.GetStatus(txIndex); statusFail && *resOut.Source.Value.AssetId != *consensus.BTMAssetID {
                                continue
                        }