Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
P
process
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
exchain
process
Commits
b5be2b39
Commit
b5be2b39
authored
Mar 07, 2025
by
贾浩@五瓣科技
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
update
parent
60e54b41
Pipeline
#831
canceled with stages
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
7 additions
and
6 deletions
+7
-6
engine.go
engine/engine.go
+7
-6
No files found.
engine/engine.go
View file @
b5be2b39
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
,
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment