shohu / c0ban

c0ban source tree
MIT License
0 stars 0 forks source link

Pass for p2p-acceptblock.py #43

Closed shohu closed 6 years ago

shohu commented 6 years ago

test code output

# test/functional/p2p-acceptblock.py
2018-06-01 09:48:59.766000 TestFramework (INFO): Initializing test directory /tmp/tests5f1hmbw
2018-06-01 09:49:00.322000 TestFramework.mininode (INFO): Connecting to Bitcoin Node: 127.0.0.1:13790
2018-06-01 09:49:00.323000 TestFramework.mininode (INFO): Connecting to Bitcoin Node: 127.0.0.1:13791
2018-06-01 09:49:00.606000 TestFramework (INFO): First height 2 block accepted by node0; correctly rejected by node1
2018-06-01 09:49:00.829000 TestFramework (INFO): Second height 2 block accepted, but not reorg'ed to
2018-06-01 09:49:00.937000 TestFramework (INFO): Unrequested more-work block accepted
2018-06-01 09:49:01.511000 TestFramework (ERROR): JSONRPC error
Traceback (most recent call last):
  File "/c0ban/test/functional/test_framework/test_framework.py", line 120, in main
    self.run_test()
  File "test/functional/p2p-acceptblock.py", line 203, in run_test
    self.nodes[0].getblock(x.hash)
  File "/c0ban/test/functional/test_framework/coverage.py", line 46, in __call__
    return_val = self.auth_service_proxy_instance.__call__(*args, **kwargs)
  File "/c0ban/test/functional/test_framework/authproxy.py", line 154, in __call__
    raise JSONRPCException(response['error'])
test_framework.authproxy.JSONRPCException: Block not found (-5)
2018-06-01 09:49:01.534000 TestFramework (INFO): Stopping nodes
2018-06-01 09:49:03.664000 TestFramework (WARNING): Not cleaning up dir /tmp/tests5f1hmbw
2018-06-01 09:49:03.664000 TestFramework (ERROR): Test failed. Test logging available at /tmp/tests5f1hmbw/test_framework.log

debug.log

2018-06-01 09:49:01.296759 TESTTTTTT CheckBlock 2
2018-06-01 09:49:01.296772 TESTTTTTT CheckBlock 3
2018-06-01 09:49:01.296784 TESTTTTTT CheckBlock 4
2018-06-01 09:49:01.296797 TESTTTTTT ProcessNewBlock 1 ret == 1
2018-06-01 09:49:01.296809 TESTTTTTT AcceptBlock 1
2018-06-01 09:49:01.296824 TESTTTTTT222 CheckBlockHeader GetPoWHash height = 0, 23e7ddad6725b513915acbaec7e5222885d5b84b86bbcbe861c09b8dc0442ee3
2018-06-01 09:49:01.296839 ERROR: AcceptBlockHeader: prev block not found
shohu commented 6 years ago

I changed to #35 source. I got success.

# test/functional/p2p-acceptblock.py
2018-06-05 07:14:25.235000 TestFramework (INFO): Initializing test directory /tmp/testad_xfclb
2018-06-05 07:14:25.506000 TestFramework.mininode (INFO): Connecting to Bitcoin Node: 127.0.0.1:14906
2018-06-05 07:14:25.506000 TestFramework.mininode (INFO): Connecting to Bitcoin Node: 127.0.0.1:14907
2018-06-05 07:14:25.783000 TestFramework (INFO): First height 2 block accepted by node0; correctly rejected by node1
2018-06-05 07:14:26.001000 TestFramework (INFO): Second height 2 block accepted, but not reorg'ed to
2018-06-05 07:14:26.108000 TestFramework (INFO): Unrequested more-work block accepted
2018-06-05 07:14:26.832000 TestFramework.mininode (INFO): Connecting to Bitcoin Node: 127.0.0.1:14906
2018-06-05 07:14:27.041000 TestFramework (INFO): Unrequested block that would complete more-work chain was ignored
2018-06-05 07:14:27.143000 TestFramework (INFO): Inv at tip triggered getdata for unprocessed block
2018-06-05 07:14:27.407000 TestFramework (INFO): Successfully reorged to longer chain from non-whitelisted peer
2018-06-05 07:14:28.266000 TestFramework (INFO): Successfully synced nodes 1 and 0
2018-06-05 07:14:28.267000 TestFramework (INFO): Stopping nodes
2018-06-05 07:14:30.490000 TestFramework (INFO): Cleaning up
2018-06-05 07:14:30.493000 TestFramework (INFO): Tests successful