mirror of
https://github.com/basicswap/basicswap.git
synced 2025-11-05 18:38:09 +01:00
prepare: Set Particl version to 27.2.2.0
Fixes zmq missing curve functions. Fix signmessage for v23.
This commit is contained in:
@@ -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,7 +1369,8 @@ def prepareDataDir(coin, settings, chain, particl_mnemonic, extra_opts={}):
|
||||
if coin == "particl":
|
||||
fp.write("deprecatedrpc=create_bdb\n")
|
||||
fp.write("debugexclude=libevent\n")
|
||||
fp.write("rpcdoccheck=0\n")
|
||||
if chain == "mainnet":
|
||||
fp.write("rpcdoccheck=0\n")
|
||||
fp.write(
|
||||
"zmqpubsmsg=tcp://{}:{}\n".format(COINS_RPCBIND_IP, settings["zmqport"])
|
||||
)
|
||||
|
||||
@@ -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.
|
||||
|
||||
@@ -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")
|
||||
|
||||
@@ -191,12 +191,22 @@ class PARTInterface(BTCInterface):
|
||||
raise RuntimeError("No non-segwit outputs found.")
|
||||
|
||||
def signMessage(self, address: str, message: str) -> str:
|
||||
message_magic: str = self.chainparams()["message_magic"]
|
||||
return self.rpc_wallet("signmessage", [address, message, message_magic])
|
||||
args = [address, message]
|
||||
if self.getDaemonVersion() > 23020700:
|
||||
message_magic: str = self.chainparams()["message_magic"]
|
||||
args += [
|
||||
message_magic,
|
||||
]
|
||||
return self.rpc_wallet("signmessage", args)
|
||||
|
||||
def signMessageWithKey(self, key_wif: str, message: str) -> str:
|
||||
message_magic: str = self.chainparams()["message_magic"]
|
||||
return self.rpc("signmessagewithprivkey", [key_wif, message, message_magic])
|
||||
args = [key_wif, message]
|
||||
if self.getDaemonVersion() > 23020700:
|
||||
message_magic: str = self.chainparams()["message_magic"]
|
||||
args += [
|
||||
message_magic,
|
||||
]
|
||||
return self.rpc("signmessagewithprivkey", args)
|
||||
|
||||
|
||||
class PARTInterfaceBlind(PARTInterface):
|
||||
|
||||
@@ -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)
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user