go fmt
This commit is contained in:
parent
da38faa8f7
commit
853053a3b2
@ -2,9 +2,9 @@ package ethchain
|
||||
|
||||
import (
|
||||
"bytes"
|
||||
"github.com/ethereum/eth-go/ethlog"
|
||||
"github.com/ethereum/eth-go/ethutil"
|
||||
"github.com/ethereum/eth-go/ethwire"
|
||||
"github.com/ethereum/eth-go/ethlog"
|
||||
"math"
|
||||
"math/big"
|
||||
)
|
||||
|
@ -1,8 +1,8 @@
|
||||
package ethchain
|
||||
|
||||
import (
|
||||
"github.com/ethereum/eth-go/ethutil"
|
||||
"github.com/ethereum/eth-go/ethlog"
|
||||
"github.com/ethereum/eth-go/ethutil"
|
||||
"github.com/obscuren/sha3"
|
||||
"hash"
|
||||
"math/big"
|
||||
@ -31,7 +31,6 @@ func (pow *EasyPow) Search(block *Block, reactChan chan ethutil.React) []byte {
|
||||
for {
|
||||
select {
|
||||
case <-reactChan:
|
||||
//powlogger.Infoln("Received reactor event; breaking out.")
|
||||
return nil
|
||||
default:
|
||||
i++
|
||||
|
@ -3,9 +3,9 @@ package ethchain
|
||||
import (
|
||||
"bytes"
|
||||
"container/list"
|
||||
"github.com/ethereum/eth-go/ethlog"
|
||||
"github.com/ethereum/eth-go/ethutil"
|
||||
"github.com/ethereum/eth-go/ethwire"
|
||||
"github.com/ethereum/eth-go/ethlog"
|
||||
"math/big"
|
||||
"sync"
|
||||
"time"
|
||||
|
@ -4,8 +4,8 @@ import (
|
||||
"bytes"
|
||||
"container/list"
|
||||
"fmt"
|
||||
"github.com/ethereum/eth-go/ethwire"
|
||||
"github.com/ethereum/eth-go/ethlog"
|
||||
"github.com/ethereum/eth-go/ethwire"
|
||||
"math/big"
|
||||
"sync"
|
||||
)
|
||||
|
@ -2,8 +2,8 @@ package ethchain
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"github.com/ethereum/eth-go/ethutil"
|
||||
"github.com/ethereum/eth-go/ethlog"
|
||||
"github.com/ethereum/eth-go/ethutil"
|
||||
"math"
|
||||
"math/big"
|
||||
)
|
||||
|
@ -5,10 +5,10 @@ import (
|
||||
"fmt"
|
||||
"github.com/ethereum/eth-go/ethchain"
|
||||
"github.com/ethereum/eth-go/ethdb"
|
||||
"github.com/ethereum/eth-go/ethlog"
|
||||
"github.com/ethereum/eth-go/ethrpc"
|
||||
"github.com/ethereum/eth-go/ethutil"
|
||||
"github.com/ethereum/eth-go/ethwire"
|
||||
"github.com/ethereum/eth-go/ethlog"
|
||||
"io/ioutil"
|
||||
"math/rand"
|
||||
"net"
|
||||
|
@ -2,10 +2,10 @@ package ethlog
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"sync"
|
||||
"log"
|
||||
"io"
|
||||
"log"
|
||||
"os"
|
||||
"sync"
|
||||
)
|
||||
|
||||
type LogSystem interface {
|
||||
@ -70,7 +70,8 @@ func start() {
|
||||
|
||||
// waits until log messages are drained (dispatched to log writers)
|
||||
func Flush() {
|
||||
for !drained {}
|
||||
for !drained {
|
||||
}
|
||||
}
|
||||
|
||||
type Logger struct {
|
||||
@ -185,4 +186,3 @@ func NewStdLogSystem(writer io.Writer, flags int, level LogLevel) *StdLogSystem
|
||||
logger := log.New(writer, "", flags)
|
||||
return &StdLogSystem{logger, level}
|
||||
}
|
||||
|
||||
|
@ -1,10 +1,10 @@
|
||||
package ethlog
|
||||
|
||||
import (
|
||||
"testing"
|
||||
"fmt"
|
||||
"io/ioutil"
|
||||
"os"
|
||||
"testing"
|
||||
)
|
||||
|
||||
type TestLogSystem struct {
|
||||
@ -107,9 +107,3 @@ func TestNoLogSystem(t *testing.T) {
|
||||
logger.Warnln("warn")
|
||||
Flush()
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
@ -3,9 +3,9 @@ package ethminer
|
||||
import (
|
||||
"bytes"
|
||||
"github.com/ethereum/eth-go/ethchain"
|
||||
"github.com/ethereum/eth-go/ethlog"
|
||||
"github.com/ethereum/eth-go/ethutil"
|
||||
"github.com/ethereum/eth-go/ethwire"
|
||||
"github.com/ethereum/eth-go/ethlog"
|
||||
"sort"
|
||||
)
|
||||
|
||||
@ -57,18 +57,23 @@ func NewDefaultMiner(coinbase []byte, ethereum ethchain.EthManager) Miner {
|
||||
|
||||
return miner
|
||||
}
|
||||
|
||||
func (miner *Miner) Start() {
|
||||
// Prepare inital block
|
||||
//miner.ethereum.StateManager().Prepare(miner.block.State(), miner.block.State())
|
||||
go miner.listener()
|
||||
logger.Infoln("Started")
|
||||
}
|
||||
|
||||
func (miner *Miner) listener() {
|
||||
out:
|
||||
for {
|
||||
select {
|
||||
case <-miner.quitChan:
|
||||
logger.Infoln("Stopped")
|
||||
break out
|
||||
case chanMessage := <-miner.reactChan:
|
||||
|
||||
if block, ok := chanMessage.Resource.(*ethchain.Block); ok {
|
||||
//logger.Infoln("Got new block via Reactor")
|
||||
if bytes.Compare(miner.ethereum.BlockChain().CurrentBlock.Hash(), block.Hash()) == 0 {
|
||||
@ -123,8 +128,9 @@ out:
|
||||
}
|
||||
|
||||
func (self *Miner) Stop() {
|
||||
self.powQuitChan <- ethutil.React{}
|
||||
logger.Infoln("Stopping...")
|
||||
self.quitChan <- true
|
||||
self.powQuitChan <- ethutil.React{}
|
||||
}
|
||||
|
||||
func (self *Miner) mineNewBlock() {
|
||||
|
@ -5,8 +5,8 @@ import (
|
||||
"encoding/hex"
|
||||
"encoding/json"
|
||||
"github.com/ethereum/eth-go/ethchain"
|
||||
"github.com/ethereum/eth-go/ethutil"
|
||||
"github.com/ethereum/eth-go/ethlog"
|
||||
"github.com/ethereum/eth-go/ethutil"
|
||||
"math/big"
|
||||
"strings"
|
||||
"sync/atomic"
|
||||
|
@ -2,8 +2,8 @@ package ethrpc
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"github.com/ethereum/eth-go/ethpub"
|
||||
"github.com/ethereum/eth-go/ethlog"
|
||||
"github.com/ethereum/eth-go/ethpub"
|
||||
"net"
|
||||
"net/rpc"
|
||||
"net/rpc/jsonrpc"
|
||||
|
@ -4,8 +4,8 @@ import (
|
||||
"flag"
|
||||
"fmt"
|
||||
"github.com/rakyll/globalconf"
|
||||
"runtime"
|
||||
"os"
|
||||
"runtime"
|
||||
)
|
||||
|
||||
// Config struct
|
||||
|
Loading…
Reference in New Issue
Block a user