Commit b5be2b39 authored by 贾浩@五瓣科技's avatar 贾浩@五瓣科技

update

parent 60e54b41
Pipeline #831 canceled with stages
package engine
import (
"sync"
"github.com/exchain/orderbook/database"
"github.com/exchain/orderbook/leveldb"
"github.com/exchain/orderbook/orderbook"
"github.com/exchain/orderbook/types"
"sync"
"github.com/exchain/go-exchain/exchain"
"github.com/exchain/go-exchain/exchain/chaindb"
......@@ -79,10 +80,10 @@ func (e *Engine) Start() {
e.InitPairs()
}
func (e *Engine) NewPayload(params exchain.PayloadParams) (*exchain.ExecutionResult, error) {
func (e *Engine) NewPayload(params exchain.PayloadParams) (exchain.ExecutionResult, error) {
parent, err := e.chainDB.GetBlockByLabel(chaindb.ExChainBlockLatest)
if err != nil {
return nil, err
return exchain.ExecutionResult{}, err
}
wParent := wrapper.NewBlkWrapper(parent)
header := &nebulav1.BlockHeader{
......@@ -96,18 +97,18 @@ func (e *Engine) NewPayload(params exchain.PayloadParams) (*exchain.ExecutionRes
}
receipts, err := e.ProcessTx(header, params.Transactions)
if err != nil {
return nil, err
return exchain.ExecutionResult{}, err
}
orderTxs, orderReceipts, err := e.ProcessOrders(header)
if err != nil {
return nil, err
return exchain.ExecutionResult{}, err
}
params.Transactions.Txs = append(params.Transactions.Txs, orderTxs.Txs...)
receipts.Receipts = append(receipts.Receipts, orderReceipts.Receipts...)
result := &exchain.ExecutionResult{
result := exchain.ExecutionResult{
Payload: &nebulav1.Block{
Header: header,
Transactions: params.Transactions,
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment