aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBojie Wu <bojie@dexon.org>2018-10-14 11:51:16 +0800
committerWei-Ning Huang <w@dexon.org>2019-04-09 13:49:52 +0800
commitf055acd1b91064ada6c4d23aeec91ced9bfc570a (patch)
tree82d4b7fd35f67e049e94e03601eeee3153c3163d
parent44ab6fe3351602707431369f9b3f2d5c845b5e8f (diff)
downloaddexon-f055acd1b91064ada6c4d23aeec91ced9bfc570a.tar
dexon-f055acd1b91064ada6c4d23aeec91ced9bfc570a.tar.gz
dexon-f055acd1b91064ada6c4d23aeec91ced9bfc570a.tar.bz2
dexon-f055acd1b91064ada6c4d23aeec91ced9bfc570a.tar.lz
dexon-f055acd1b91064ada6c4d23aeec91ced9bfc570a.tar.xz
dexon-f055acd1b91064ada6c4d23aeec91ced9bfc570a.tar.zst
dexon-f055acd1b91064ada6c4d23aeec91ced9bfc570a.zip
app: pass chain config instead of nil
-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
}