shohu / c0ban

c0ban source tree
MIT License
0 stars 0 forks source link

AssertionError: Error: no RPC connection at python test #34

Closed shohu closed 6 years ago

shohu commented 6 years ago

I changed algorithm. I got following error when I run python test.

# test/functional/wallet-hd.py
2018-05-30 06:39:55.298000 TestFramework (INFO): Initializing test directory /tmp/testb9omp9vk
2018-05-30 06:40:07.858000 TestFramework (INFO): Restore backup ...
: Error loading block database.
Please restart with -reindex or -reindex-chainstate to recover.
2018-05-30 06:40:16.475000 TestFramework (ERROR): Assertion failed
Traceback (most recent call last):
  File "/c0ban/test/functional/test_framework/test_framework.py", line 120, in main
    self.run_test()
  File "test/functional/wallet-hd.py", line 91, in run_test
    self.start_node(1, extra_args=self.extra_args[1] + ['-rescan'])
  File "/c0ban/test/functional/test_framework/test_framework.py", line 239, in start_node
    node.wait_for_rpc_connection()
  File "/c0ban/test/functional/test_framework/test_node.py", line 86, in wait_for_rpc_connection
    assert self.process.poll() is None, "c0band exited with status %i during initialization" % self.process.returncode
AssertionError: c0band exited with status 1 during initialization
2018-05-30 06:40:16.490000 TestFramework (INFO): Stopping nodes
Traceback (most recent call last):
  File "test/functional/wallet-hd.py", line 105, in <module>
    WalletHDTest().main ()
  File "/c0ban/test/functional/test_framework/test_framework.py", line 143, in main
    self.stop_nodes()
  File "/c0ban/test/functional/test_framework/test_framework.py", line 273, in stop_nodes
    node.stop_node()
  File "/c0ban/test/functional/test_framework/test_node.py", line 119, in stop_node
    self.stop()
  File "/c0ban/test/functional/test_framework/test_node.py", line 68, in __getattr__
    assert self.rpc_connected and self.rpc is not None, "Error: no RPC connection"
AssertionError: Error: no RPC connection

Error log

2018-05-30 06:40:16.319834 ERROR: LoadBlockIndexGuts: CheckProofOfWork failed: CBlockIndex(pprev=0x558719a9cc60, nHeight=275, merkle=03d5e386a2c31047dedec8c6a07201c3db5dd631443758f643dcb5f3dd087dd1, hashBlock=a4746122ae7ae0d3500421bc7f3d0c0972a97089d794ff72ca38e6281844f401)
2018-05-30 06:40:16.319864 : Error loading block database.
Please restart with -reindex or -reindex-chainstate to recover.

It's cause following parameter ...

        nSwitchLyra2REv2_DIFF = 200;

I got success when I specify following parameter

        // Hardfork params
        nSwitchLyra2REv2_DIFF = 140000;

This parameter is "switch alogrithm". Test "wallet-hd.py" create over 200 blocks. So I got Error

shohu commented 6 years ago

I passed this test by followin changed

2018-05-31 14 21 24

The parameter of CheckProofOfWork has been changed from GetBlockHash to GetPoWHash.