|
|
@ -1,11 +1,9 @@ |
|
|
|
# -*- coding: utf-8 -*- |
|
|
|
# -*- coding: utf-8 -*- |
|
|
|
|
|
|
|
|
|
|
|
# Copyright (c) 2020-2023 tecnovert |
|
|
|
# Copyright (c) 2020-2024 tecnovert |
|
|
|
# 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. |
|
|
|
|
|
|
|
|
|
|
|
from sqlalchemy.orm import scoped_session |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
from basicswap.util import ( |
|
|
|
from basicswap.util import ( |
|
|
|
ensure, |
|
|
|
ensure, |
|
|
|
) |
|
|
|
) |
|
|
@ -45,7 +43,7 @@ def addLockRefundSigs(self, xmr_swap, ci): |
|
|
|
def recoverNoScriptTxnWithKey(self, bid_id: bytes, encoded_key): |
|
|
|
def recoverNoScriptTxnWithKey(self, bid_id: bytes, encoded_key): |
|
|
|
self.log.info('Manually recovering %s', bid_id.hex()) |
|
|
|
self.log.info('Manually recovering %s', bid_id.hex()) |
|
|
|
# Manually recover txn if other key is known |
|
|
|
# Manually recover txn if other key is known |
|
|
|
session = scoped_session(self.session_factory) |
|
|
|
session = self.openSession() |
|
|
|
try: |
|
|
|
try: |
|
|
|
bid, xmr_swap = self.getXmrBidFromSession(session, bid_id) |
|
|
|
bid, xmr_swap = self.getXmrBidFromSession(session, bid_id) |
|
|
|
ensure(bid, 'Bid not found: {}.'.format(bid_id.hex())) |
|
|
|
ensure(bid, 'Bid not found: {}.'.format(bid_id.hex())) |
|
|
@ -86,8 +84,7 @@ def recoverNoScriptTxnWithKey(self, bid_id: bytes, encoded_key): |
|
|
|
|
|
|
|
|
|
|
|
return txid |
|
|
|
return txid |
|
|
|
finally: |
|
|
|
finally: |
|
|
|
session.close() |
|
|
|
self.closeSession(session, commit=False) |
|
|
|
session.remove() |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
def getChainBSplitKey(swap_client, bid, xmr_swap, offer): |
|
|
|
def getChainBSplitKey(swap_client, bid, xmr_swap, offer): |
|
|
|