Commit graph

14 commits

Author SHA1 Message Date
Patrick Lodder caf26b77ab
fixup p2p-acceptblock and mininode to test disconnects
without partially backporting a new testframework.

- Adds a condition to NodeConn that when asyncore calls handle_read
  without any data, this must be a disconnect and closes the socket
- Adds a little loop in the p2p-acceptblock client that waits for
  the socket to be in a closed state
- Makes expected disconnects non-optional in p2p-acceptblock
- Syncs the test descriptions and outputs with reality
2021-08-17 20:15:30 +02:00
Dakoda Greaves fb194d7319
p2p-acceptblock: add steps 8, 9 to confirm node disconnects 2021-08-17 20:13:54 +02:00
Patrick Lodder 6aff1141f4
qa: fix p2p-acceptblock
This test failed because the sheer number of blocks required to
trigger the max length of a fork we'd keep, exceed the v4 fork
height on regtest.

- Adapted the blocktools.py miner to mine 0x00620004 blocks as done
  elsewhere too (be it suboptimal, but at least consistent)
- Adapted the test to work with 1440 blocks (Dogecoin limit)
  instead of 288 (Bitcoin limit)
- Made p2p-acceptblock a standard test instead of an extended test
2021-08-13 03:44:02 +02:00
Ross Nicoll 4dd8838b3a Rename binaries to match Dogecoin 2019-03-25 05:36:11 +00:00
John Newbery fe51c8924e Return correct error codes in blockchain.cpp.
RPCs in blockchain.cpp were returning misleading or incorrect error
codes (for example getblock() returning RPC_INTERNAL_ERROR when the
block had been pruned). This commit fixes those error codes:

- RPC_INTERNAL_ERROR should not be returned for application-level
  errors, only for genuine internal errors such as corrupted data.
- RPC_METHOD_NOT_FOUND should not be returned in response to a
  JSON request for an existing method.

Those error codes have been replaced with RPC_MISC_ERROR or
RPC_INVALID_PARAMETER as appropriate.

Github-Pull: #9853
Rebased-From: c1190963b3
2017-06-05 19:01:16 +00:00
MarcoFalke fac9349798 [qa] Remove hardcoded "4 nodes" from test_framework 2016-05-15 12:58:53 +02:00
MarcoFalke fa389d4edc [qa] Switch to py3 2016-05-05 15:43:37 +02:00
MarcoFalke fa2cea163b [qa] rpc-tests: Properly use integers, floats 2016-04-01 21:23:30 +02:00
MarcoFalke fa60d05a4e Add missing copyright headers 2016-01-05 21:34:15 +01:00
Wladimir J. van der Laan 2f601d215d test: remove necessity to call create_callback_map
Remove necessity to call create_callback_map (as well as the function
itself) from the Python P2P test framework. Invoke the appropriate
methods directly.

- Easy to forget to call it and wonder why it doesn't work
- Simplifies the code
- This makes it easier to handle new messages in subclasses
2015-12-04 13:15:59 +01:00
Casey Rodarmor 0ce73985a8 Add p2p-fullblocktest.py 2015-08-21 15:31:37 -04:00
Suhas Daftuar 04b5d235f1 Replace sleep with syncing using pings 2015-06-30 09:42:56 -04:00
Suhas Daftuar bfc30b3437 Ignore unrequested blocks too far ahead of tip 2015-06-03 11:36:04 -04:00
Suhas Daftuar aa8c827968 P2P regression test for new AcceptBlock behavior 2015-06-02 14:01:35 -04:00