prepare: Set Particl version to 27.2.2.0

Fixes zmq missing curve functions.
Fix signmessage for v23.
This commit is contained in:
tecnovert
2025-08-06 15:12:20 +02:00
parent a171bbb48a
commit 7ee1931176
6 changed files with 27 additions and 13 deletions

View File

@@ -51,7 +51,7 @@ from basicswap.bin.run import (
# Coin clients
PARTICL_REPO = os.getenv("PARTICL_REPO", "tecnovert")
PARTICL_VERSION = os.getenv("PARTICL_VERSION", "27.2.1.0")
PARTICL_VERSION = os.getenv("PARTICL_VERSION", "27.2.2.0")
PARTICL_VERSION_TAG = os.getenv("PARTICL_VERSION_TAG", "")
PARTICL_LINUX_EXTRA = os.getenv("PARTICL_LINUX_EXTRA", "nousb")
@@ -1369,6 +1369,7 @@ def prepareDataDir(coin, settings, chain, particl_mnemonic, extra_opts={}):
if coin == "particl":
fp.write("deprecatedrpc=create_bdb\n")
fp.write("debugexclude=libevent\n")
if chain == "mainnet":
fp.write("rpcdoccheck=0\n")
fp.write(
"zmqpubsmsg=tcp://{}:{}\n".format(COINS_RPCBIND_IP, settings["zmqport"])

View File

@@ -53,6 +53,7 @@ class CoinInterface:
self._network = network
self._mx_wallet = threading.Lock()
self._altruistic = True
self._core_version = None # Set in getDaemonVersion()
def interface_type(self) -> int:
# coin_type() returns the base coin type, interface_type() returns the coin+balance type.

View File

@@ -364,7 +364,9 @@ class BTCInterface(Secp256k1Interface):
self.rpc_wallet("getwalletinfo" if with_wallet else "getblockchaininfo")
def getDaemonVersion(self):
return self.rpc("getnetworkinfo")["version"]
if self._core_version is None:
self._core_version = self.rpc("getnetworkinfo")["version"]
return self._core_version
def getBlockchainInfo(self):
return self.rpc("getblockchaininfo")

View File

@@ -191,12 +191,22 @@ class PARTInterface(BTCInterface):
raise RuntimeError("No non-segwit outputs found.")
def signMessage(self, address: str, message: str) -> str:
args = [address, message]
if self.getDaemonVersion() > 23020700:
message_magic: str = self.chainparams()["message_magic"]
return self.rpc_wallet("signmessage", [address, message, message_magic])
args += [
message_magic,
]
return self.rpc_wallet("signmessage", args)
def signMessageWithKey(self, key_wif: str, message: str) -> str:
args = [key_wif, message]
if self.getDaemonVersion() > 23020700:
message_magic: str = self.chainparams()["message_magic"]
return self.rpc("signmessagewithprivkey", [key_wif, message, message_magic])
args += [
message_magic,
]
return self.rpc("signmessagewithprivkey", args)
class PARTInterfaceBlind(PARTInterface):

View File

@@ -287,7 +287,10 @@ class XMRInterface(CoinInterface):
self.rpc_wallet("get_languages")
def getDaemonVersion(self):
return self.rpc_wallet("get_version")["version"]
# Returns wallet version
if self._core_version is None:
self._core_version = self.rpc_wallet("get_version")["version"]
return self._core_version
def getBlockchainInfo(self):
get_height = self.rpc2("get_height", timeout=self._rpctimeout)

View File

@@ -169,6 +169,8 @@ class BSXNetwork:
if have_smsg:
self._have_smsg_rpc = True
if self._can_use_smsg_payload2:
self.callrpc("smsgoptions", ["set", "addReceivedPubkeys", False])
if self._zmq_queue_enabled:
self.zmqContext = zmq.Context()
self.zmqSubscriber = self.zmqContext.socket(zmq.SUB)
@@ -228,11 +230,6 @@ class BSXNetwork:
finally:
self.closeDB(cursor)
# TODO: Ensure smsg is enabled for the active wallet.
if self._can_use_smsg_payload2:
self.callrpc("smsgoptions", ["set", "addReceivedPubkeys", False])
now: int = self.getTime()
# Load portal data