diff options
author | Bojie Wu <bojie@dexon.org> | 2018-10-14 11:51:16 +0800 |
---|---|---|
committer | Wei-Ning Huang <w@dexon.org> | 2019-04-09 21:32:49 +0800 |
commit | 946d4fdec65f396890e65bc1905b1422055ec46d (patch) | |
tree | c6525d659338b2cf46675d7ac64bcf52fc1bf0f9 /dex | |
parent | 1da23cc940d308e5376e3056c2737ddd2f01642a (diff) | |
download | dexon-946d4fdec65f396890e65bc1905b1422055ec46d.tar.gz dexon-946d4fdec65f396890e65bc1905b1422055ec46d.tar.zst dexon-946d4fdec65f396890e65bc1905b1422055ec46d.zip |
app: pass chain config instead of nil
Diffstat (limited to 'dex')
-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 } |