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
5acc09bd
Commit
5acc09bd
authored
Sep 02, 2019
by
linj
Committed by
vipwzw
Sep 05, 2019
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
price: update sell market exec
parent
f265dde9
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
7 additions
and
1 deletion
+7
-1
tradedb.go
plugin/dapp/trade/executor/tradedb.go
+7
-1
No files found.
plugin/dapp/trade/executor/tradedb.go
View file @
5acc09bd
...
@@ -237,6 +237,8 @@ func (buydb *buyDB) getSellLogs(sellerAddr string, sellID string, boardlotCnt in
...
@@ -237,6 +237,8 @@ func (buydb *buyDB) getSellLogs(sellerAddr string, sellID string, boardlotCnt in
TxHash
:
txhash
,
TxHash
:
txhash
,
Height
:
buydb
.
Height
,
Height
:
buydb
.
Height
,
AssetExec
:
buydb
.
AssetExec
,
AssetExec
:
buydb
.
AssetExec
,
PriceExec
:
buydb
.
PriceExec
,
PriceSymbol
:
buydb
.
PriceSymbol
,
}
}
receiptSellMarket
:=
&
pty
.
ReceiptSellMarket
{
Base
:
base
}
receiptSellMarket
:=
&
pty
.
ReceiptSellMarket
{
Base
:
base
}
log
.
Log
=
types
.
Encode
(
receiptSellMarket
)
log
.
Log
=
types
.
Encode
(
receiptSellMarket
)
...
@@ -567,9 +569,13 @@ func (action *tradeAction) tradeSellMarket(sellOrder *pty.TradeForSellMarket) (*
...
@@ -567,9 +569,13 @@ func (action *tradeAction) tradeSellMarket(sellOrder *pty.TradeForSellMarket) (*
}
}
//首先购买费用的划转
//首先购买费用的划转
priceAcc
,
err
:=
createPriceDB
(
action
.
height
,
action
.
db
,
buyOrder
.
PriceExec
,
buyOrder
.
PriceSymbol
)
if
err
!=
nil
{
return
nil
,
err
}
amount
:=
sellOrder
.
BoardlotCnt
*
buyOrder
.
PricePerBoardlot
amount
:=
sellOrder
.
BoardlotCnt
*
buyOrder
.
PricePerBoardlot
tradelog
.
Debug
(
"tradeSellMarket"
,
"step2 cnt"
,
sellOrder
.
BoardlotCnt
,
"price"
,
buyOrder
.
PricePerBoardlot
,
"amount"
,
amount
)
tradelog
.
Debug
(
"tradeSellMarket"
,
"step2 cnt"
,
sellOrder
.
BoardlotCnt
,
"price"
,
buyOrder
.
PricePerBoardlot
,
"amount"
,
amount
)
receiptFromAcc
,
err
:=
action
.
coinsAccount
.
ExecTransferFrozen
(
buyOrder
.
Address
,
action
.
fromaddr
,
action
.
execaddr
,
amount
)
receiptFromAcc
,
err
:=
priceAcc
.
ExecTransferFrozen
(
buyOrder
.
Address
,
action
.
fromaddr
,
action
.
execaddr
,
amount
)
if
err
!=
nil
{
if
err
!=
nil
{
tradelog
.
Error
(
"account.Transfer "
,
"addrFrom"
,
buyOrder
.
Address
,
"addrTo"
,
action
.
fromaddr
,
tradelog
.
Error
(
"account.Transfer "
,
"addrFrom"
,
buyOrder
.
Address
,
"addrTo"
,
action
.
fromaddr
,
"amount"
,
amount
)
"amount"
,
amount
)
...
...
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