"github.com/bytom/errors"
"github.com/bytom/crypto"
//"bytom/protocol/bc/legacy"
-
- //"github.com/bytom/blockchain/config"
- "github.com/bytom/blockchain/config"
"github.com/pborman/uuid"
)
File string `json:"file"`
}
- func New(/*conf *config.Config*/) *HSM {
- keydir, _ := filepath.Abs("~/.bytom")
++
+ func New(keypath string) (*HSM, error) {
+ keydir, _ := filepath.Abs(keypath)
return &HSM{
keyStore: &keyStorePassphrase{keydir, LightScryptN, LightScryptP},
cache: newAddrCache(keydir),
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
- accesstoken *accesstoken.Token
- 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
+ handler http.Handler
+ fastSync bool
+ requestsCh chan BlockRequest
+ timeoutsCh chan string
+ submitter txbuilder.Submitter
+ hsm hsmSigner
- chain *protocol.Chain
- store *txdb.Store
- accounts *account.Manager
- assets *asset.Registry
- txFeeds *txfeed.TxFeed
- pool *BlockPool
- mux *http.ServeMux
- accesstoken *accesstoken.Token
-
- fastSync bool
- requestsCh chan BlockRequest
- timeoutsCh chan string
- submitter txbuilder.Submitter
- evsw types.EventSwitch
+ evsw types.EventSwitch
}
func batchRecover(ctx context.Context, v *interface{}) {
LastPage bool `json:"last_page"`
}
- func NewBlockchainReactor(store *txdb.Store, chain *protocol.Chain, txPool *protocol.TxPool, accounts *account.Manager, assets *asset.Registry, fastSync bool) *BlockchainReactor {
-func NewBlockchainReactor(store *txdb.Store, chain *protocol.Chain, accounts *account.Manager, assets *asset.Registry, hsm hsmSigner, fastSync bool) *BlockchainReactor {
++
++func NewBlockchainReactor(store *txdb.Store, chain *protocol.Chain, txPool *protocol.TxPool, accounts *account.Manager, assets *asset.Registry, hsm hsmSigner, fastSync bool) *BlockchainReactor {
requestsCh := make(chan BlockRequest, defaultChannelCapacity)
timeoutsCh := make(chan string, defaultChannelCapacity)
pool := NewBlockPool(