Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
P
plugin
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
JIRA
JIRA
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
link33
plugin
Commits
f147b859
Commit
f147b859
authored
Sep 03, 2019
by
linj
Committed by
vipwzw
Sep 05, 2019
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
add log
parent
5c5035b3
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
4 additions
and
1 deletion
+4
-1
tradedb.go
plugin/dapp/trade/executor/tradedb.go
+4
-1
No files found.
plugin/dapp/trade/executor/tradedb.go
View file @
f147b859
...
...
@@ -349,6 +349,8 @@ func (action *tradeAction) tradeBuy(buyOrder *pty.TradeForBuy) (*types.Receipt,
priceAcc
,
err
:=
createPriceDB
(
action
.
height
,
action
.
db
,
sellOrder
.
PriceExec
,
sellOrder
.
PriceSymbol
)
if
err
!=
nil
{
tradelog
.
Error
(
"createPriceDB"
,
"addrFrom"
,
action
.
fromaddr
,
"height"
,
action
.
height
,
"price"
,
sellOrder
.
PriceExec
+
"-"
+
sellOrder
.
PriceSymbol
,
"err"
,
err
)
return
nil
,
err
}
//首先购买费用的划转
...
...
@@ -359,9 +361,10 @@ func (action *tradeAction) tradeBuy(buyOrder *pty.TradeForBuy) (*types.Receipt,
return
nil
,
err
}
//然后实现购买token的转移,因为这部分token在之前的卖单生成时已经进行冻结
//TODO: 创建一个LRU用来保存token对应的子合约账户的地址
accDB
,
err
:=
createAccountDB
(
action
.
height
,
action
.
db
,
sellOrder
.
AssetExec
,
sellOrder
.
TokenSymbol
)
if
err
!=
nil
{
tradelog
.
Error
(
"createAccountDB"
,
"addrFrom"
,
action
.
fromaddr
,
"height"
,
action
.
height
,
"price"
,
sellOrder
.
AssetExec
+
"-"
+
sellOrder
.
TokenSymbol
,
"err"
,
err
)
return
nil
,
err
}
receiptFromExecAcc
,
err
:=
accDB
.
ExecTransferFrozen
(
sellOrder
.
Address
,
action
.
fromaddr
,
action
.
execaddr
,
buyOrder
.
BoardlotCnt
*
sellOrder
.
AmountPerBoardlot
)
...
...
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