diff options
| author | Adam Soltys <[email protected]> | 2014-08-22 23:43:31 -0700 |
|---|---|---|
| committer | Adam Soltys <[email protected]> | 2014-08-22 23:43:31 -0700 |
| commit | 23a8677ed4353f3f0b9072a50d07c2febb511444 (patch) | |
| tree | 32a7a053dc3b586db770fba2f367e6b8a42ae632 /public | |
| parent | dec12454289461e6851b3b7328b5a80f56ce4a98 (diff) | |
| download | coinos-server-23a8677ed4353f3f0b9072a50d07c2febb511444.tar.gz coinos-server-23a8677ed4353f3f0b9072a50d07c2febb511444.zip | |
Move txid check
Diffstat (limited to 'public')
| -rw-r--r-- | public/js/calculator.coffee | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/public/js/calculator.coffee b/public/js/calculator.coffee index e1e97cef..29c1d006 100644 --- a/public/js/calculator.coffee +++ b/public/js/calculator.coffee @@ -161,20 +161,21 @@ setupSocket = -> g.btcd.onmessage = (e) -> data = JSON.parse(e.data) - txid = data.result.txid - return if txid == g.last - g.last = txid amount_received = 0 if data.result + txid = data.result.txid + return if txid == g.last + g.last = txid + for output in data.result.vout if g.address in output.scriptPubKey.addresses amount_received += parseFloat(output.value) if g.user $.post("/#{g.user}/transactions", - txid: data.result.txid, + txid: txid, date: moment().format("YYYY-MM-DD HH:mm:ss"), received: amount_received, tip: g.tip, |
