Browse Source

Ravencoin: Switch algo to x16rv2 after activation date (#895)

* Ravencoin: Switch algo to x16rv2 after activation date
Update txcounts
Remove public servers from list (all dead)

* Travis: install x16rv2_hash
patch-2
standard-error 5 years ago
committed by Neil
parent
commit
b35d23e02f
  1. 1
      .travis.yml
  2. 29
      electrumx/lib/coins.py
  3. 23
      tests/blocks/ravencoin_testnet_424000.json

1
.travis.yml

@ -37,6 +37,7 @@ install:
- pip install pycryptodomex
- pip install git+https://github.com/Electra-project/nist5_hash
- pip install git+https://github.com/RitoProject/x21s_hash
- pip install git+https://github.com/traysi/x16rv2_hash
- pip install bell-yespower
- pip install cpupower
# command to run tests

29
electrumx/lib/coins.py

@ -2969,6 +2969,7 @@ class Ritocoin(Coin):
PEERS = [
'electrum-rito.minermore.com s t'
]
@classmethod
def header_hash(cls, header):
'''Given a header return the hash.'''
@ -2987,21 +2988,25 @@ class Ravencoin(Coin):
GENESIS_HASH = ('0000006b444bc2f2ffe627be9d9e7e7a'
'0730000870ef6eb6da46c8eae389df90')
DESERIALIZER = lib_tx.DeserializerSegWit
TX_COUNT = 3911020
TX_COUNT_HEIGHT = 602000
TX_PER_BLOCK = 4
X16RV2_ACTIVATION_TIME = 1569945600 # algo switch to x16rv2 at this timestamp
TX_COUNT = 5626682
TX_COUNT_HEIGHT = 887000
TX_PER_BLOCK = 6
RPC_PORT = 8766
REORG_LIMIT = 55
PEERS = [
'rvn.satoshi.org.uk s t',
'electrum-rvn.minermore.com s t',
'153.126.197.243 s t'
]
@classmethod
def header_hash(cls, header):
'''Given a header return the hash.'''
import x16r_hash
return x16r_hash.getPoWHash(header)
timestamp = util.unpack_le_uint32_from(header, 68)[0]
if timestamp >= cls.X16RV2_ACTIVATION_TIME:
import x16rv2_hash
return x16rv2_hash.getPoWHash(header)
else:
import x16r_hash
return x16r_hash.getPoWHash(header)
class RavencoinTestnet(Ravencoin):
@ -3013,14 +3018,14 @@ class RavencoinTestnet(Ravencoin):
WIF_BYTE = bytes.fromhex("EF")
GENESIS_HASH = ('000000ecfc5e6324a079542221d00e10'
'362bdc894d56500c414060eea8a3ad5a')
TX_COUNT = 108085
TX_COUNT_HEIGHT = 60590
TX_PER_BLOCK = 4
X16RV2_ACTIVATION_TIME = 1567533600
TX_COUNT = 496158
TX_COUNT_HEIGHT = 420500
TX_PER_BLOCK = 1
RPC_PORT = 18766
PEER_DEFAULT_PORTS = {'t': '50003', 's': '50004'}
REORG_LIMIT = 55
PEERS = [
'rvn.satoshi.org.uk s t'
]

23
tests/blocks/ravencoin_testnet_424000.json

@ -0,0 +1,23 @@
{
"hash": "000000049aabfb33d6767b02942f167506604c18ee84a71964bfbee4874e2e94",
"confirmations": 405,
"strippedsize": 245,
"size": 281,
"weight": 1016,
"height": 424000,
"version": 1342177280,
"versionHex": "50000000",
"merkleroot": "7ad0d336ba84e1df5e4b4d5166e176ac8ef3993c1fa4f49b9584a3135d6bcc7a",
"tx": [
"7ad0d336ba84e1df5e4b4d5166e176ac8ef3993c1fa4f49b9584a3135d6bcc7a"
],
"time": 1568942728,
"mediantime": 1568942609,
"nonce": 2208067584,
"bits": "1d05a3a5",
"difficulty": 0.1773262657174631,
"chainwork": "000000000000000000000000000000000000000000000000000034d496753368",
"previousblockhash": "00000003a5a7200c799a131ec0fe39d1484f58473f0c1b911540f2bf6e9bbe2f",
"nextblockhash": "00000002654f6bae0e602eb32900586ffd2035c0331c50e862ecdee053953c1a",
"block": "000000502fbe9b6ebff24015911b0c3f47584f48d139fec01e139a790c20a7a5030000007acc6b5d13a384959bf4a41f3c99f38eac76e166514d4b5edfe184ba36d3d07a882a845da5a3051d00709c8301010000000001010000000000000000000000000000000000000000000000000000000000000000ffffffff200340780604882a845d08d6c61088010000000d2f6e6f64655374726174756d2f00000000020000000000000000266a24aa21a9ede2f61c3f71d1defd3fa999dfa36953755c690689799962b48bebd836974e8cf90088526a740000001976a91467f8037a52d10988b41989432ccf5a096600b1dd88ac0120000000000000000000000000000000000000000000000000000000000000000000000000"
}
Loading…
Cancel
Save