Skip to content
This repository was archived by the owner on Mar 28, 2023. It is now read-only.

Commit 79e46b2

Browse files
committed
Do not use updated contract as update into db
1 parent dca0c2e commit 79e46b2

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

api/jsonapi.go

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1784,7 +1784,7 @@ func (i *jsonAPIHandler) POSTRefund(w http.ResponseWriter, r *http.Request) {
17841784
ErrorResponse(w, http.StatusBadRequest, err.Error())
17851785
return
17861786
}
1787-
_, state, _, records, _, _, err := i.node.Datastore.Sales().GetByOrderId(can.OrderID)
1787+
contract, state, _, records, _, _, err := i.node.Datastore.Sales().GetByOrderId(can.OrderID)
17881788
if err != nil {
17891789
ErrorResponse(w, http.StatusNotFound, "order not found")
17901790
return
@@ -1809,7 +1809,7 @@ func (i *jsonAPIHandler) POSTRefund(w http.ResponseWriter, r *http.Request) {
18091809
//contract.BuyerOrder.Payment.Coin = paymentCoin.String()
18101810
}
18111811

1812-
err = i.node.RefundOrder(v5contract, records)
1812+
err = i.node.RefundOrder(contract, records)
18131813
if err != nil {
18141814
ErrorResponse(w, http.StatusInternalServerError, err.Error())
18151815
return
@@ -1995,7 +1995,7 @@ func (i *jsonAPIHandler) POSTOrderFulfill(w http.ResponseWriter, r *http.Request
19951995
ErrorResponse(w, http.StatusBadRequest, err.Error())
19961996
return
19971997
}
1998-
_, state, _, records, _, _, err := i.node.Datastore.Sales().GetByOrderId(fulfill.OrderId)
1998+
contract, state, _, records, _, _, err := i.node.Datastore.Sales().GetByOrderId(fulfill.OrderId)
19991999
if err != nil {
20002000
ErrorResponse(w, http.StatusNotFound, "order not found")
20012001
return
@@ -2020,7 +2020,7 @@ func (i *jsonAPIHandler) POSTOrderFulfill(w http.ResponseWriter, r *http.Request
20202020
ErrorResponse(w, http.StatusBadRequest, "order must be in state AWAITING_FULFILLMENT or PARTIALLY_FULFILLED to fulfill")
20212021
return
20222022
}
2023-
err = i.node.FulfillOrder(&fulfill, v5contract, records)
2023+
err = i.node.FulfillOrder(&fulfill, contract, records)
20242024
if err != nil {
20252025
ErrorResponse(w, http.StatusInternalServerError, err.Error())
20262026
return

0 commit comments

Comments
 (0)