Skip to content
This repository was archived by the owner on May 16, 2019. It is now read-only.

Commit 61f915c

Browse files
committed
Return total amount funded with partial funding websocket notification
1 parent dcd6f31 commit 61f915c

File tree

1 file changed

+1
-3
lines changed

1 file changed

+1
-3
lines changed

market/contracts.py

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -861,14 +861,12 @@ def on_tx_received(self, address_version, address_hash, height, block_hash, tx):
861861

862862
# get the amount (in satoshi) the user is expected to pay
863863
amount_to_pay = int(float(self.contract["buyer_order"]["order"]["payment"]["amount"]) * 100000000)
864-
val = 0
865864
if tx not in self.received_txs: # make sure we aren't parsing the same tx twice.
866865
outpoints = transaction.check_for_funding(
867866
self.contract["buyer_order"]["order"]["payment"]["address"])
868867
if outpoints is not None:
869868
for outpoint in outpoints:
870869
self.amount_funded += outpoint["value"]
871-
val += outpoint["value"]
872870
self.received_txs.append(tx)
873871
self.outpoints.append(outpoint)
874872
if self.amount_funded >= amount_to_pay: # if fully funded
@@ -878,7 +876,7 @@ def on_tx_received(self, address_version, address_hash, height, block_hash, tx):
878876
notification_json = {
879877
"notification": {
880878
"type": "partial payment",
881-
"amount": val,
879+
"amount_funded": self.amount_funded,
882880
"order_id": order_id
883881
}
884882
}

0 commit comments

Comments
 (0)