mirror of
https://github.com/basicswap/basicswap.git
synced 2025-11-05 18:38:09 +01:00
Fix backwards compatibility.
This commit is contained in:
@@ -3674,7 +3674,7 @@ class BasicSwap(BaseApp, BSXNetwork, UIApp):
|
|||||||
msg_valid,
|
msg_valid,
|
||||||
use_cursor,
|
use_cursor,
|
||||||
message_nets=bid.message_nets,
|
message_nets=bid.message_nets,
|
||||||
payload_version=bid.smsg_payload_version,
|
payload_version=offer.smsg_payload_version,
|
||||||
)
|
)
|
||||||
|
|
||||||
self.addMessageLink(
|
self.addMessageLink(
|
||||||
@@ -3748,7 +3748,8 @@ class BasicSwap(BaseApp, BSXNetwork, UIApp):
|
|||||||
|
|
||||||
# Set msg_buf.message_nets to let the remote node know what networks to respond on.
|
# Set msg_buf.message_nets to let the remote node know what networks to respond on.
|
||||||
# bid.message_nets is a local field denoting the network/s to send to
|
# bid.message_nets is a local field denoting the network/s to send to
|
||||||
msg_buf.message_nets = self.getMessageNetsString()
|
if offer.smsg_payload_version > 1:
|
||||||
|
msg_buf.message_nets = self.getMessageNetsString()
|
||||||
|
|
||||||
return msg_buf
|
return msg_buf
|
||||||
|
|
||||||
@@ -3797,7 +3798,8 @@ class BasicSwap(BaseApp, BSXNetwork, UIApp):
|
|||||||
|
|
||||||
# Set msg_buf.message_nets to let the remote node know what networks to respond on.
|
# Set msg_buf.message_nets to let the remote node know what networks to respond on.
|
||||||
# bid.message_nets is a local field denoting the network/s to send to
|
# bid.message_nets is a local field denoting the network/s to send to
|
||||||
msg_buf.message_nets = self.getMessageNetsString()
|
if offer.smsg_payload_version > 1:
|
||||||
|
msg_buf.message_nets = self.getMessageNetsString()
|
||||||
|
|
||||||
return msg_buf
|
return msg_buf
|
||||||
|
|
||||||
@@ -3883,7 +3885,8 @@ class BasicSwap(BaseApp, BSXNetwork, UIApp):
|
|||||||
|
|
||||||
# Set msg_buf.message_nets to let the remote node know what networks to respond on.
|
# Set msg_buf.message_nets to let the remote node know what networks to respond on.
|
||||||
# bid.message_nets is a local field denoting the network/s to send to
|
# bid.message_nets is a local field denoting the network/s to send to
|
||||||
msg_buf.message_nets = self.getMessageNetsString()
|
if offer.smsg_payload_version > 1:
|
||||||
|
msg_buf.message_nets = self.getMessageNetsString()
|
||||||
|
|
||||||
return msg_buf
|
return msg_buf
|
||||||
|
|
||||||
|
|||||||
@@ -260,7 +260,6 @@ class Bid(Table):
|
|||||||
chain_b_height_start = Column("integer")
|
chain_b_height_start = Column("integer")
|
||||||
|
|
||||||
reject_code = Column("integer")
|
reject_code = Column("integer")
|
||||||
smsg_payload_version = Column("integer")
|
|
||||||
|
|
||||||
initiate_tx = None
|
initiate_tx = None
|
||||||
participate_tx = None
|
participate_tx = None
|
||||||
|
|||||||
@@ -293,17 +293,21 @@ class BSXNetwork:
|
|||||||
|
|
||||||
use_cursor = self.openDB(cursor)
|
use_cursor = self.openDB(cursor)
|
||||||
try:
|
try:
|
||||||
query: str = "SELECT pk_from FROM offers WHERE addr_from = :addr_to LIMIT 1"
|
query: str = (
|
||||||
rows = use_cursor.execute(query, {"addr_to": addr}).fetchall()
|
"SELECT pk_from FROM offers WHERE addr_from = :addr AND pk_from IS NOT NULL LIMIT 1"
|
||||||
|
)
|
||||||
|
rows = use_cursor.execute(query, {"addr": addr}).fetchall()
|
||||||
if len(rows) > 0:
|
if len(rows) > 0:
|
||||||
return rows[0][0]
|
return rows[0][0]
|
||||||
query: str = (
|
query: str = (
|
||||||
"SELECT pk_bid_addr FROM bids WHERE bid_addr = :addr_to LIMIT 1"
|
"SELECT pk_bid_addr FROM bids WHERE bid_addr = :addr AND pk_bid_addr IS NOT NULL LIMIT 1"
|
||||||
)
|
)
|
||||||
rows = use_cursor.execute(query, {"addr_to": addr}).fetchall()
|
rows = use_cursor.execute(query, {"addr": addr}).fetchall()
|
||||||
if len(rows) > 0:
|
if len(rows) > 0:
|
||||||
return rows[0][0]
|
return rows[0][0]
|
||||||
query: str = "SELECT pubkey FROM smsgaddresses WHERE addr = :addr LIMIT 1"
|
query: str = (
|
||||||
|
"SELECT pubkey FROM smsgaddresses WHERE addr = :addr AND pubkey IS NOT NULL LIMIT 1"
|
||||||
|
)
|
||||||
rows = use_cursor.execute(query, {"addr": addr}).fetchall()
|
rows = use_cursor.execute(query, {"addr": addr}).fetchall()
|
||||||
if len(rows) > 0:
|
if len(rows) > 0:
|
||||||
return bytes.fromhex(rows[0][0])
|
return bytes.fromhex(rows[0][0])
|
||||||
|
|||||||
Reference in New Issue
Block a user