The changes here are dense and subtle, but hopefully all is more explicit
than before.
- CConnman is now in charge of sending data rather than the nodes themselves.
This is necessary because many decisions need to be made with all nodes in
mind, and a model that requires the nodes calling up to their manager quickly
turns to spaghetti.
- The per-node-serializer (ssSend) has been replaced with a (quasi-)const
send-version. Since the send version for serialization can only change once
per connection, we now explicitly tag messages with INIT_PROTO_VERSION if
they are sent before the handshake. With this done, there's no need to lock
for access to nSendVersion.
Also, a new stream is used for each message, so there's no need to lock
during the serialization process.
- This takes care of accounting for optimistic sends, so the
nOptimisticBytesWritten hack can be removed.
- -dropmessagestest and -fuzzmessagestest have not been preserved, as I suspect
they haven't been used in years.
LogPrint("net","peer=%d does not offer the expected services (%08x offered, %08x expected); disconnecting\n",pfrom->id,pfrom->nServices,pfrom->nServicesExpected);
LogPrint("net","peer=%d does not offer the expected services (%08x offered, %08x expected); disconnecting\n",pfrom->id,pfrom->nServices,pfrom->nServicesExpected);
LogPrint("net","send version message: version %d, blocks=%d, us=%s, them=%s, peer=%d\n",PROTOCOL_VERSION,nNodeStartingHeight,addrMe.ToString(),addrYou.ToString(),id);
else
LogPrint("net","send version message: version %d, blocks=%d, us=%s, peer=%d\n",PROTOCOL_VERSION,nNodeStartingHeight,addrMe.ToString(),id);
}
voidCConnman::DumpBanlist()
voidCConnman::DumpBanlist()
{
{
SweepBanned();// clean unused entries (if bantime has expired)
SweepBanned();// clean unused entries (if bantime has expired)
LogPrint("net","send version message: version %d, blocks=%d, us=%s, them=%s, peer=%d\n",PROTOCOL_VERSION,nMyStartingHeight,addrMe.ToString(),addrYou.ToString(),id);
else
LogPrint("net","send version message: version %d, blocks=%d, us=%s, peer=%d\n",PROTOCOL_VERSION,nMyStartingHeight,addrMe.ToString(),id);