From 6cee15544f08fa64f1feab57fbaa7a9a24333cac Mon Sep 17 00:00:00 2001 From: Calin Culianu Date: Mon, 4 Feb 2019 04:23:13 +0200 Subject: [PATCH] Implemented update_required for BitcoinCash and BitcoinCashTestnet (#717) Anti-phishing: If the client version < 3.3.4, will return the error message telling user to upgrade at electroncash.org --- electrumx/lib/coins.py | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/electrumx/lib/coins.py b/electrumx/lib/coins.py index b16928d..c09eaee 100644 --- a/electrumx/lib/coins.py +++ b/electrumx/lib/coins.py @@ -403,6 +403,17 @@ class BitcoinCash(BitcoinMixin, Coin): ] BLOCK_PROCESSOR = block_proc.LTORBlockProcessor + @classmethod + def upgrade_required(cls, client_ver): + if client_ver < (3, 3, 4): + return ('

' + 'Your transaction was successfully broadcast.

' + 'However, you are using a VULNERABLE version of Electron Cash.
' + 'Download the latest version from this web site ONLY:
' + 'https://electroncash.org/' + '

') + return False + class BitcoinSegwit(BitcoinMixin, Coin): NAME = "BitcoinSegwit" @@ -600,6 +611,17 @@ class BitcoinCashTestnet(BitcoinTestnetMixin, Coin): ] BLOCK_PROCESSOR = block_proc.LTORBlockProcessor + @classmethod + def upgrade_required(cls, client_ver): + if client_ver < (3, 3, 4): + return ('

' + 'Your transaction was successfully broadcast.

' + 'However, you are using a VULNERABLE version of Electron Cash.
' + 'Download the latest version from this web site ONLY:
' + 'https://electroncash.org/' + '

') + return False + class BitcoinSVRegtest(BitcoinSVTestnet): NET = "regtest"