aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDeterminant <[email protected]>2019-08-14 16:04:43 -0400
committerDeterminant <[email protected]>2019-08-14 16:04:43 -0400
commit63fc17f85121f84d597742a49b99ab3d022aa6bd (patch)
treef5c0f4136445ba1b1d2c0bb6ac728d9ab382c4c4
parent499f682b48f914ed4af0e32ba446dd0cf56e96b4 (diff)
...
-rw-r--r--consensus/dummy/consensus.go2
-rw-r--r--examples/payments/main.go4
-rw-r--r--miner/worker.go5
3 files changed, 5 insertions, 6 deletions
diff --git a/consensus/dummy/consensus.go b/consensus/dummy/consensus.go
index 2a9441d..6b03844 100644
--- a/consensus/dummy/consensus.go
+++ b/consensus/dummy/consensus.go
@@ -192,7 +192,7 @@ uncles []*types.Header, receipts []*types.Receipt) (*types.Block, error) {
}
func (self *DummyEngine) Seal(chain consensus.ChainReader, block *types.Block, results chan<- *types.Block, stop <-chan struct{}) error {
- time.Sleep(1000 * time.Millisecond)
+ //time.Sleep(1000 * time.Millisecond)
fmt.Printf("sealed %s\n", block.ParentHash().String())
results <- block
return nil
diff --git a/examples/payments/main.go b/examples/payments/main.go
index 9609359..46e4e58 100644
--- a/examples/payments/main.go
+++ b/examples/payments/main.go
@@ -58,7 +58,7 @@ func main() {
config.Miner.ManualMining = true
chainID := chainConfig.ChainID
- nonce := uint64(1)
+ nonce := uint64(0)
value := big.NewInt(1000000000000)
gasLimit := 21000
gasPrice := big.NewInt(1000)
@@ -71,7 +71,7 @@ func main() {
tx := types.NewTransaction(nonce, bob.Address, value, uint64(gasLimit), gasPrice, nil)
signedTx, err := types.SignTx(tx, types.NewEIP155Signer(chainID), genKey.PrivateKey); checkError(err)
chain.AddLocalTxs([]*types.Transaction{signedTx})
- time.Sleep(1000 * time.Millisecond)
+ time.Sleep(2000 * time.Millisecond)
nonce++
chain.GenBlock()
}
diff --git a/miner/worker.go b/miner/worker.go
index 5124758..cb0ec7b 100644
--- a/miner/worker.go
+++ b/miner/worker.go
@@ -28,7 +28,7 @@ import (
"sync"
"sync/atomic"
"time"
- "fmt"
+ //"fmt"
mapset "github.com/deckarep/golang-set"
"github.com/ethereum/go-ethereum/common"
@@ -294,7 +294,7 @@ func (w *worker) close() {
func (w *worker) genBlock() {
interrupt := new(int32)
- *interrupt = commitInterruptNewHead
+ *interrupt = commitInterruptNone
w.newWorkCh <- &newWorkReq{
interrupt: interrupt,
noempty: false,
@@ -635,7 +635,6 @@ func (w *worker) resultLoop() {
// Insert the block into the set of pending ones to resultLoop for confirmations
w.unconfirmed.Insert(block.NumberU64(), block.Hash())
- fmt.Printf("new parent: %s\n", w.chain.CurrentBlock().Hash().String())
case <-w.exitCh:
return