aboutsummaryrefslogtreecommitdiffstats
path: root/dex
diff options
context:
space:
mode:
authorBojie Wu <bojie@dexon.org>2018-10-14 11:51:16 +0800
committerWei-Ning Huang <w@byzantine-lab.io>2019-06-12 17:23:39 +0800
commit5f8563ccfbd0700ffe0cd88e97c911d060fce99a (patch)
treebcf8edcd1e5049676133159606e33815cf811a09 /dex
parent046ea228bf3892a01b8de060390e766483a69249 (diff)
downloadgo-tangerine-5f8563ccfbd0700ffe0cd88e97c911d060fce99a.tar
go-tangerine-5f8563ccfbd0700ffe0cd88e97c911d060fce99a.tar.gz
go-tangerine-5f8563ccfbd0700ffe0cd88e97c911d060fce99a.tar.bz2
go-tangerine-5f8563ccfbd0700ffe0cd88e97c911d060fce99a.tar.lz
go-tangerine-5f8563ccfbd0700ffe0cd88e97c911d060fce99a.tar.xz
go-tangerine-5f8563ccfbd0700ffe0cd88e97c911d060fce99a.tar.zst
go-tangerine-5f8563ccfbd0700ffe0cd88e97c911d060fce99a.zip
app: pass chain config instead of nil
Diffstat (limited to 'dex')
-rw-r--r--dex/app.go9
1 files changed, 6 insertions, 3 deletions
diff --git a/dex/app.go b/dex/app.go
index a882e04ec..06b5a5381 100644
--- a/dex/app.go
+++ b/dex/app.go
@@ -20,6 +20,7 @@ package dex
import (
"bytes"
"fmt"
+ "github.com/dexon-foundation/dexon/log"
"math/big"
"sync"
"time"
@@ -137,7 +138,7 @@ func (d *DexconApp) PreparePayload(position coreTypes.Position) (payload []byte,
// or else check compaction chain state
if i == 0 {
nonce = tx.Nonce()
- msg, err := tx.AsMessage(types.MakeSigner(nil, currentBlock.Header().Number))
+ msg, err := tx.AsMessage(types.MakeSigner(d.blockchain.Config(), currentBlock.Header().Number))
if err != nil {
return nil, err
}
@@ -230,7 +231,7 @@ func (d *DexconApp) VerifyBlock(block *coreTypes.Block) bool {
return false
}
- msg, err := transaction.AsMessage(types.MakeSigner(nil, currentBlock.Header().Number))
+ msg, err := transaction.AsMessage(types.MakeSigner(d.blockchain.Config(), currentBlock.Header().Number))
if err != nil {
return false
}
@@ -323,12 +324,14 @@ func (d *DexconApp) BlockDelivered(blockHash coreCommon.Hash, result coreTypes.F
block := d.blockchain.GetConfirmedBlockByHash(blockHash)
if block == nil {
// do something
+ log.Error("can not get confirmed block")
return
}
var transactions types.Transactions
err := rlp.Decode(bytes.NewReader(block.Payload), &transactions)
if err != nil {
+ log.Error("payload rlp decode error: %v", err)
return
}
@@ -341,7 +344,7 @@ func (d *DexconApp) BlockDelivered(blockHash coreCommon.Hash, result coreTypes.F
Coinbase: common.BytesToAddress(block.ProposerID.Hash[:]),
}, transactions, nil, nil)})
if err != nil {
- // do something
+ log.Error("insert chain error: %v", err)
return
}