OSDN Git Service

manage package
authorzhouyasong <zhouarrogant@outlook.com>
Thu, 21 Sep 2017 14:08:06 +0000 (22:08 +0800)
committerzhouyasong <zhouarrogant@outlook.com>
Thu, 21 Sep 2017 14:08:06 +0000 (22:08 +0800)
blockchain/reactor.go
crypto/ed25519/chainkd/chainkd.go
crypto/ed25519/chainkd/util.go
crypto/ed25519/ecmath/point.go
crypto/ed25519/ecmath/scalar.go
crypto/ed25519/ed25519.go
crypto/ed25519/ed25519_test.go

index 65c51ac..b0daed6 100644 (file)
@@ -8,8 +8,6 @@ import (
        "reflect"
        "time"
 
-       "github.com/bytom/mining/cpuminer"
-       "github.com/bytom/protocol/validation"
        "github.com/bytom/blockchain/accesstoken"
        "github.com/bytom/blockchain/account"
        "github.com/bytom/blockchain/asset"
@@ -17,9 +15,11 @@ import (
        "github.com/bytom/blockchain/txfeed"
        "github.com/bytom/encoding/json"
        "github.com/bytom/log"
+       "github.com/bytom/mining/cpuminer"
        "github.com/bytom/p2p"
        "github.com/bytom/protocol"
        "github.com/bytom/protocol/bc/legacy"
+       "github.com/bytom/protocol/validation"
        "github.com/bytom/types"
        wire "github.com/tendermint/go-wire"
        cmn "github.com/tendermint/tmlibs/common"
@@ -55,34 +55,22 @@ const (
 type BlockchainReactor struct {
        p2p.BaseReactor
 
-       chain      *protocol.Chain
-       store      *txdb.Store
-       accounts   *account.Manager
-       assets     *asset.Registry
-       txFeeds    *txfeed.TxFeed
-       pool       *BlockPool
-       txPool     *protocol.TxPool
-       mining     *cpuminer.CPUMiner
-       mux        *http.ServeMux
-       handler    http.Handler
-       fastSync   bool
-       requestsCh chan BlockRequest
-       timeoutsCh chan string
-       submitter  txbuilder.Submitter
        chain       *protocol.Chain
        store       *txdb.Store
        accounts    *account.Manager
        assets      *asset.Registry
        txFeeds     *txfeed.TxFeed
        pool        *BlockPool
+       txPool      *protocol.TxPool
+       mining      *cpuminer.CPUMiner
        mux         *http.ServeMux
-       accesstoken *accesstoken.Token
        handler     http.Handler
        fastSync    bool
        requestsCh  chan BlockRequest
        timeoutsCh  chan string
+       accesstoken *accesstoken.Token
        submitter   txbuilder.Submitter
-       evsw types.EventSwitch
+       evsw        types.EventSwitch
 }
 
 func batchRecover(ctx context.Context, v *interface{}) {
@@ -261,7 +249,7 @@ func NewBlockchainReactor(store *txdb.Store, chain *protocol.Chain, accounts *ac
                requestsCh,
                timeoutsCh,
        )
-       mining := cpuminer.NewCPUMiner(chain, txPool)
+       //      mining := cpuminer.NewCPUMiner(chain, txPool)
        bcR := &BlockchainReactor{
                chain:      chain,
                store:      store,
@@ -333,12 +321,12 @@ func (bcR *BlockchainReactor) Receive(chID byte, src *p2p.Peer, msgBytes []byte)
 
        switch msg := msg.(type) {
        case *bcBlockRequestMessage:
-/*             // Got a request for a block. Respond with block if we have it.
-               rawBlock, err := bcR.store.GetRawBlock(msg.Height)
-               //fmt.Printf("sent block %v \n", rawBlock)
-               if err == nil {
-                       msg := &bcBlockResponseMessage{RawBlock: rawBlock}
-*/             block, _ := bcR.store.GetBlock(msg.Height)
+               /*              // Got a request for a block. Respond with block if we have it.
+                               rawBlock, err := bcR.store.GetRawBlock(msg.Height)
+                               //fmt.Printf("sent block %v \n", rawBlock)
+                               if err == nil {
+                                       msg := &bcBlockResponseMessage{RawBlock: rawBlock}
+               */block, _ := bcR.store.GetBlock(msg.Height)
                if block != nil {
                        msg := &bcBlockResponseMessage{Block: block}
                        queued := src.TrySend(BlockchainChannel, struct{ BlockchainMessage }{msg})
index b82a6b6..5066f35 100644 (file)
@@ -7,8 +7,8 @@ import (
        "hash"
        "io"
 
-       "bytom/crypto/ed25519"
-       "bytom/crypto/ed25519/internal/edwards25519"
+       "github.com/bytom/crypto/ed25519"
+       "github.com/bytom/crypto/ed25519/internal/edwards25519"
 )
 
 type (
@@ -31,7 +31,7 @@ func NewXPrv(r io.Reader) (xprv XPrv, err error) {
                return xprv, err
        }
        hasher := sha512.New()
-       hasher.Write([]byte("Bytom seed"))
+       hasher.Write([]byte("Chain seed"))
        hasher.Write(entropy[:])
        hasher.Sum(xprv[:0])
        modifyScalar(xprv[:32])
index b880a92..194b20e 100644 (file)
@@ -3,7 +3,7 @@ package chainkd
 import (
        "io"
 
-       "bytom/crypto/ed25519"
+       "github.com/bytom/crypto/ed25519"
 )
 
 // Utility functions
index 23cfeae..9ec0d75 100644 (file)
@@ -3,7 +3,7 @@ package ecmath
 import (
        "crypto/subtle"
 
-       "github.com/blockchain/crypto/ed25519/internal/edwards25519"
+       "github.com/bytom/crypto/ed25519/internal/edwards25519"
 )
 
 // Point is a point on the ed25519 curve.
index b51be2a..651f2ca 100644 (file)
@@ -3,7 +3,7 @@ package ecmath
 import (
        "crypto/subtle"
 
-       "bytom/crypto/ed25519/internal/edwards25519"
+       "github.com/bytom/crypto/ed25519/internal/edwards25519"
 )
 
 // Scalar is a 256-bit little-endian scalar.
index 6e1b786..a25bc57 100644 (file)
@@ -22,7 +22,7 @@ import (
        "io"
        "strconv"
 
-       "bytom/crypto/ed25519/internal/edwards25519"
+       "github.com/bytom/crypto/ed25519/internal/edwards25519"
 )
 
 const (
index 8233b44..68e14a4 100644 (file)
@@ -16,7 +16,7 @@ import (
        "strings"
        "testing"
 
-       "bytom/crypto/ed25519/internal/edwards25519"
+       "github.com/bytom/crypto/ed25519/internal/edwards25519"
 )
 
 type zeroReader struct{}