diff options
author | Bojie Wu <bojie@dexon.org> | 2018-10-14 11:51:16 +0800 |
---|---|---|
committer | Wei-Ning Huang <w@dexon.org> | 2018-12-19 20:54:27 +0800 |
commit | 7f0898896dc1176af08c63a3f26977c150568f76 (patch) | |
tree | 504e66f50ef58df1ba953d81d13591fc16ecef65 /dex/app.go | |
parent | a468fd43993733d7ad89c14d038d91e88e12f611 (diff) | |
download | dexon-7f0898896dc1176af08c63a3f26977c150568f76.tar.gz dexon-7f0898896dc1176af08c63a3f26977c150568f76.tar.zst dexon-7f0898896dc1176af08c63a3f26977c150568f76.zip |
app: pass chain config instead of nil
Diffstat (limited to 'dex/app.go')
-rw-r--r-- | dex/app.go | 9 |
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 } |