remove PoW from ID

This commit is contained in:
Ethan Buchman
2018-01-13 15:38:40 -05:00
parent b1485b181a
commit 9670519a21
3 changed files with 44 additions and 59 deletions

View File

@ -368,11 +368,8 @@ func (n *Node) OnStart() error {
n.sw.AddListener(l)
// Generate node PrivKey
// TODO: both the loading function and the target
// will need to be configurable
difficulty := uint8(16) // number of leading 0s in bitstring
target := p2p.MakePoWTarget(difficulty)
nodeKey, err := p2p.LoadOrGenNodeKey(n.config.NodeKeyFile(), target)
// TODO: the loading function will need to be configurable
nodeKey, err := p2p.LoadOrGenNodeKey(n.config.NodeKeyFile())
if err != nil {
return err
}
@ -381,7 +378,6 @@ func (n *Node) OnStart() error {
// Start the switch
n.sw.SetNodeInfo(n.makeNodeInfo(nodeKey.PubKey()))
n.sw.SetNodeKey(nodeKey)
n.sw.SetPeerIDTarget(target)
err = n.sw.Start()
if err != nil {
return err