A comment in the code (checkpoints.cpp - see below) states "TestNet has no checkpoints", but Checkpoints::GetTotalBlocksEstimate() does mapCheckpointsTestnet.rbegin()->first - which dereferences the iterator returned by rbegin().
But: "If the container is empty, the returned iterator value shall not be dereferenced."
I tried to run two instances of clamd (on two separate hosts) with "-testnet", and have one of
them connect to the other (with connect=.... or addnode=....). Both instances instantly crash
with a SIGSEGV after the version message is received.
This modification avoids the crash (by adding one checkpoint - the testnet genesis block):
I'm not sure if this is an appropriate solution - maybe simply checking if the map is empty and handle that case appropriately in the 3 occurrences of mapCheckpointsTestnet in checkpoints.cpp
would be better...
Hi,
A comment in the code (checkpoints.cpp - see below) states "TestNet has no checkpoints", but Checkpoints::GetTotalBlocksEstimate() does
mapCheckpointsTestnet.rbegin()->first
- which dereferences the iterator returned by rbegin(). But: "If the container is empty, the returned iterator value shall not be dereferenced."I tried to run two instances of clamd (on two separate hosts) with "-testnet", and have one of them connect to the other (with connect=.... or addnode=....). Both instances instantly crash with a SIGSEGV after the version message is received.
This modification avoids the crash (by adding one checkpoint - the testnet genesis block):
I'm not sure if this is an appropriate solution - maybe simply checking if the map is empty and handle that case appropriately in the 3 occurrences of mapCheckpointsTestnet in checkpoints.cpp would be better...
Best regards