From b4ac4b6a0538e81a69315db881d039f77a04d5e0 Mon Sep 17 00:00:00 2001 From: FujiCoin Date: Fri, 18 Aug 2017 17:05:54 +0900 Subject: [PATCH] Add Fujicoin (#218) * Add Fujicoin * Add explanation of FujiDaemon --- lib/coins.py | 23 +++++++++++++++++++++-- server/daemon.py | 12 ++++++++++++ 2 files changed, 33 insertions(+), 2 deletions(-) diff --git a/lib/coins.py b/lib/coins.py index ba7f3ff..5c4109c 100644 --- a/lib/coins.py +++ b/lib/coins.py @@ -42,7 +42,7 @@ from lib.script import ScriptPubKey from lib.tx import Deserializer, DeserializerSegWit, DeserializerAuxPow, \ DeserializerZcash, DeserializerTxTime, DeserializerReddcoin from server.block_processor import BlockProcessor -from server.daemon import Daemon, DashDaemon, LegacyRPCDaemon +from server.daemon import Daemon, DashDaemon, LegacyRPCDaemon, FujiDaemon from server.session import ElectrumX, DashElectrumX @@ -926,4 +926,23 @@ class Crown(AuxPowMixin, Coin): TX_COUNT = 13336629 TX_COUNT_HEIGHT = 1268206 TX_PER_BLOCK = 10 - RPC_PORT = 9341 \ No newline at end of file + RPC_PORT = 9341 + +class Fujicoin(Coin): + NAME = "Fujicoin" + SHORTNAME = "FJC" + NET = "mainnet" + XPUB_VERBYTES = bytes.fromhex("0488b21e") + XPRV_VERBYTES = bytes.fromhex("0488ade4") + P2PKH_VERBYTE = bytes.fromhex("24") + P2SH_VERBYTES = [bytes.fromhex("10")] + WIF_BYTE = bytes.fromhex("a4") + GENESIS_HASH = ('adb6d9cfd74075e7f91608add4bd2a2e' + 'a636f70856183086842667a1597714a0') +# DESERIALIZER = DeserializerSegWit + DAEMON = FujiDaemon + TX_COUNT = 170478 + TX_COUNT_HEIGHT = 1521676 + TX_PER_BLOCK = 1 + RPC_PORT = 3776 +# REORG_LIMIT = 1000 diff --git a/server/daemon.py b/server/daemon.py index 5e9b311..b078620 100644 --- a/server/daemon.py +++ b/server/daemon.py @@ -272,6 +272,18 @@ class DashDaemon(Daemon): '''Return the masternode status.''' return await self._send_single('masternodelist', params) +class FujiDaemon(Daemon): + '''This is a measure against coin daemon which does not have the 'estimatefee' command. + When the electrum is in 'Use dynamic fees' mode, the estimatefee does not return from electrum-X, so the user can not remit money. + See class Fujicoin() in lib/coins.py for usage.''' + async def estimatefee(self, params): + '''Return the fee estimate for the given parameters.''' + return 0.001 + + async def relayfee(self): + '''The minimum fee a low-priority tx must pay in order to be accepted + to the daemon's memory pool.''' + return 0.001 class LegacyRPCDaemon(Daemon): '''Handles connections to a daemon at the given URL.