Merge branch 'dev' into dev

This commit is contained in:
Gerlof van Ek
2024-02-29 13:43:28 +01:00
committed by GitHub
4 changed files with 79 additions and 594 deletions

View File

@@ -184,8 +184,6 @@ def page_bids(self, url_split, post_string, sent=False, available=False, receive
bids = swap_client.listBids(sent=sent, filters=filters)
bids_count = len(bids)
page_data = {
'bid_states': listBidStates(),
}
@@ -203,5 +201,5 @@ def page_bids(self, url_split, post_string, sent=False, available=False, receive
'summary': summary,
'bids': [(format_timestamp(b[0]),
b[2].hex(), b[3].hex(), strBidState(b[5]), strTxState(b[7]), strTxState(b[8]), b[11]) for b in bids],
'bids_count': bids_count, # Pass the count of offers to the template
'bids_count': len(bids),
})

View File

@@ -25,7 +25,6 @@ from basicswap.db import (
from basicswap.util import (
ensure,
format_amount,
format_timestamp,
)
from basicswap.basicswap_util import (
SwapTypes,
@@ -43,6 +42,7 @@ from basicswap.chainparams import (
default_chart_api_key = '95dd900af910656e0e17c41f2ddc5dba77d01bf8b0e7d2787634a16bd976c553'
def value_or_none(v):
if v == -1 or v == '-1':
return None
@@ -661,8 +661,6 @@ def page_offer(self, url_split, post_string):
'summary': summary,
})
import time
def format_timestamp(timestamp, with_ago=True, is_expired=False):
current_time = int(time.time())