mirror of
https://github.com/basicswap/basicswap.git
synced 2026-02-28 16:45:11 +01:00
Compare commits
3 Commits
1346d47d17
...
a04ce28ca2
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
a04ce28ca2 | ||
|
|
52da86bc86 | ||
|
|
1d5778a72c |
@@ -1280,12 +1280,17 @@ class BasicSwap(BaseApp, BSXNetwork, UIApp):
|
|||||||
else:
|
else:
|
||||||
self.log.info("AMM autostart is disabled")
|
self.log.info("AMM autostart is disabled")
|
||||||
|
|
||||||
self._price_fetch_running = True
|
if self.settings.get("fetchpricesthread", True):
|
||||||
self._price_fetch_thread = threading.Thread(
|
self._price_fetch_running = True
|
||||||
target=self._backgroundPriceFetchLoop, daemon=True
|
self._price_fetch_thread = threading.Thread(
|
||||||
|
target=self._backgroundPriceFetchLoop, daemon=True
|
||||||
|
)
|
||||||
|
self._price_fetch_thread.start()
|
||||||
|
self.log.info(
|
||||||
|
"Background price fetching {}".format(
|
||||||
|
"started" if self._price_fetch_running else "is disabled"
|
||||||
|
)
|
||||||
)
|
)
|
||||||
self._price_fetch_thread.start()
|
|
||||||
self.log.info("Background price fetching started")
|
|
||||||
|
|
||||||
if "htmlhost" in self.settings:
|
if "htmlhost" in self.settings:
|
||||||
self.log.info(
|
self.log.info(
|
||||||
@@ -3271,7 +3276,9 @@ class BasicSwap(BaseApp, BSXNetwork, UIApp):
|
|||||||
self.log.debug(f"logBidEvent {self.log.id(bid_id)} {event_type}")
|
self.log.debug(f"logBidEvent {self.log.id(bid_id)} {event_type}")
|
||||||
self.logEvent(Concepts.BID, bid_id, event_type, event_msg, cursor)
|
self.logEvent(Concepts.BID, bid_id, event_type, event_msg, cursor)
|
||||||
|
|
||||||
def countEvents(self, linked_type: int, linked_id: bytes, event_type: int, cursor):
|
def countEvents(
|
||||||
|
self, linked_type: int, linked_id: bytes, event_type: int, cursor
|
||||||
|
) -> int:
|
||||||
q = cursor.execute(
|
q = cursor.execute(
|
||||||
"SELECT COUNT(*) FROM eventlog WHERE linked_type = :linked_type AND linked_id = :linked_id AND event_type = :event_type",
|
"SELECT COUNT(*) FROM eventlog WHERE linked_type = :linked_type AND linked_id = :linked_id AND event_type = :event_type",
|
||||||
{
|
{
|
||||||
@@ -3282,8 +3289,8 @@ class BasicSwap(BaseApp, BSXNetwork, UIApp):
|
|||||||
).fetchone()
|
).fetchone()
|
||||||
return q[0]
|
return q[0]
|
||||||
|
|
||||||
def countBidEvents(self, bid, event_type: int, cursor):
|
def countBidEvents(self, bid, event_type: int, cursor) -> int:
|
||||||
return self.countEvents(int(Concepts.BID), bid.bid_id, int(event_type))
|
return self.countEvents(int(Concepts.BID), bid.bid_id, int(event_type), cursor)
|
||||||
|
|
||||||
def getEvents(self, linked_type: int, linked_id: bytes):
|
def getEvents(self, linked_type: int, linked_id: bytes):
|
||||||
events = []
|
events = []
|
||||||
|
|||||||
@@ -2,7 +2,7 @@
|
|||||||
# -*- coding: utf-8 -*-
|
# -*- coding: utf-8 -*-
|
||||||
|
|
||||||
# Copyright (c) 2021-2024 tecnovert
|
# Copyright (c) 2021-2024 tecnovert
|
||||||
# Copyright (c) 2024-2025 The Basicswap developers
|
# Copyright (c) 2024-2026 The Basicswap developers
|
||||||
# Distributed under the MIT software license, see the accompanying
|
# Distributed under the MIT software license, see the accompanying
|
||||||
# file LICENSE or http://www.opensource.org/licenses/mit-license.php.
|
# file LICENSE or http://www.opensource.org/licenses/mit-license.php.
|
||||||
|
|
||||||
@@ -921,10 +921,10 @@ class BasicSwapTest(TestFunctions):
|
|||||||
@classmethod
|
@classmethod
|
||||||
def setUpClass(cls):
|
def setUpClass(cls):
|
||||||
super(BasicSwapTest, cls).setUpClass()
|
super(BasicSwapTest, cls).setUpClass()
|
||||||
if False:
|
|
||||||
for client in cls.swap_clients:
|
@classmethod
|
||||||
client.log.safe_logs = True
|
def addCoinSettings(cls, settings, datadir, node_id):
|
||||||
client.log.safe_logs_prefix = b"tests"
|
settings["fetchpricesthread"] = False
|
||||||
|
|
||||||
def test_001_nested_segwit(self):
|
def test_001_nested_segwit(self):
|
||||||
# p2sh-p2wpkh
|
# p2sh-p2wpkh
|
||||||
|
|||||||
Reference in New Issue
Block a user