File tree 1 file changed +5
-2
lines changed
1 file changed +5
-2
lines changed Original file line number Diff line number Diff line change @@ -157,14 +157,17 @@ def do_GET(self):
157
157
# need to investigate further, but this seems to work.
158
158
str_wallet_balance = str (proxy ._call ("getbalance" ))
159
159
160
- transactions = proxy ._call ("listtransactions" , "" , 50 )
160
+ transactions = proxy ._call ("listtransactions" , "" , 1000 )
161
161
# We want only the confirmed txs containing an OP_RETURN, from most to least recent
162
162
transactions = list (filter (lambda x : x ["confirmations" ] > 0 and x ["amount" ] == 0 , transactions ))
163
163
a_week_ago = (datetime .date .today () - datetime .timedelta (days = 7 )).timetuple ()
164
164
a_week_ago_posix = time .mktime (a_week_ago )
165
165
transactions_in_last_week = list (filter (lambda x : x ["time" ] > a_week_ago_posix , transactions ))
166
166
fees_in_last_week = reduce (lambda a ,b : a - b ["fee" ], transactions_in_last_week , 0 )
167
- time_between_transactions = round (168 / len (transactions_in_last_week )) # in hours based on 168 hours in a week
167
+ try :
168
+ time_between_transactions = round (168 / len (transactions_in_last_week )) # in hours based on 168 hours in a week
169
+ except ZeroDivisionError :
170
+ time_between_transactions = "Infinite"
168
171
transactions .sort (key = lambda x : x ["confirmations" ])
169
172
homepage_template = """<html>
170
173
<head>
You can’t perform that action at this time.
0 commit comments