Commit graph

506 commits

Author SHA1 Message Date
SChernykh
f77e0434c6 Fixed TCPServer startup 2021-08-27 00:19:01 +02:00
SChernykh
3f1ee9ce4b TCPServer fixes
- Proper shutdown sequence, uv_close() must be called from the event loop thread
- Moved start_listening() to child class constructor because it must be ready before it can listen on sockets
- Added simple memory leak detector for Windows. Linux users can enjoy the leak sanitizer
2021-08-26 23:57:59 +02:00
SChernykh
27e85a922b TCPServer: fixed more leaks on shutdown 2021-08-26 19:14:04 +02:00
SChernykh
4ba32277c1 Use p2pool-api branch for Monero 2021-08-26 15:36:40 +02:00
SChernykh
37f3312e1d Submit received p2pool blocks to monerod when possible 2021-08-25 22:07:42 +02:00
SChernykh
125815b502 Made print_status() thread-safe 2021-08-25 21:00:06 +02:00
SChernykh
63e442dffd print_status: fixed next payout display 2021-08-25 18:52:09 +02:00
SChernykh
0009eba307 Fix RandomX startup logic
Ensure that both RandomX caches initialize before stratum and p2p servers start.
2021-08-25 18:31:42 +02:00
SChernykh
276cc5f0fd Fix Mac compilation 2021-08-25 18:16:26 +02:00
SChernykh
fa3146a8f3 Reverted force close TCP connections 2021-08-25 17:27:46 +02:00
SChernykh
230d3e4780 Fixed socket leak after a failed connection 2021-08-25 17:18:59 +02:00
SChernykh
d246ee1552 Enabled block cache for Mac 2021-08-25 16:26:15 +02:00
SChernykh
46b7c3e755 TCPServer: stop reading before closing connection 2021-08-25 16:19:21 +02:00
SChernykh
662865ad70 Reduced startup spam at log levels <= 5 2021-08-25 15:01:05 +02:00
SChernykh
68a4765f95 Force close TCP connections 2021-08-25 14:53:45 +02:00
SChernykh
924fd4b7bd TCPServer: better tracking of used sockets 2021-08-25 13:58:00 +02:00
SChernykh
a38a7be73f p2pool: submit block from the main thread only 2021-08-25 12:45:14 +02:00
SChernykh
8f93adf7a1 Refactored signal handler
Call the same stop() function as regular exit command
2021-08-25 12:28:15 +02:00
SChernykh
d8efb27374 Restrict uv_default_loop() to main thread 2021-08-25 12:17:14 +02:00
SChernykh
dbf18c34a4 Fixed wrong uv loop in p2pserver::flush_cache() 2021-08-25 11:31:50 +02:00
SChernykh
fcb9e25fb1 Print background jobs in status 2021-08-25 11:31:35 +02:00
SChernykh
7ab3c22114 Give only 5 seconds for new connections to complete handshake
This is to detect random port scans/non-p2pool connections quickly
2021-08-25 11:14:23 +02:00
SChernykh
336349e189 Show hashrate estimate in status 2021-08-25 11:13:38 +02:00
SChernykh
8f2493edfc Log message fixes 2021-08-25 09:52:06 +02:00
SChernykh
a27577f735 Added log level 6 to reduce spam on level 5
Log level 5 is still default
2021-08-25 09:38:47 +02:00
SChernykh
09aedd9f9a Drop idle connections
Idle = didn't send any full messages in the last 5 minutes
2021-08-24 21:45:19 +02:00
SChernykh
cd532965e8 Code safety: BlockCache isn't supposed to be copied/moved 2021-08-24 21:06:47 +02:00
SChernykh
64885852dd Limit max number of transactions in block template
Because if it's too high, it won't fit into p2p packet
2021-08-24 20:54:02 +02:00
SChernykh
6de98697a1 Only warn about lagging monerod if it's 2 or more blocks behind 2021-08-24 20:10:16 +02:00
SChernykh
02449bf9f9 Use UTC time for logging 2021-08-24 18:56:14 +02:00
SChernykh
e4be4c1a66 Fixed pruning logic
- Erase an element from m_blocksByHeight only if it's empty
- Remove blocks from unconnected alternative chains too when they get old enough (4xPPLNS window)
2021-08-24 18:34:28 +02:00
SChernykh
d4388bf9c0 Removed unnecessary lock 2021-08-24 17:56:36 +02:00
SChernykh
20b3886bfb Less tolerance to lagging nodes
Ban nodes that are 5 or more Monero blocks behind.
2021-08-24 17:19:10 +02:00
SChernykh
a55545762b Merge branch 'master' of https://github.com/SChernykh/p2pool 2021-08-24 13:46:53 +02:00
SChernykh
69533fd209 Store only fully verified blocks in the cache 2021-08-24 13:46:38 +02:00
SChernykh
90a977228b
Merge pull request #2 from hyc/cmds
Tweak command handling
2021-08-24 14:37:03 +03:00
SChernykh
4837b4c863 Added missing integrity check 2021-08-24 13:33:55 +02:00
SChernykh
15354e5a88 Update util.cpp 2021-08-24 13:22:56 +02:00
Howard Chu
0dc3baa480 Tweak command handling
Modularize, add help and exit commands.
Fix shutdown_tcp() and p2pool to make sure servers exit immediately
when terminating.
2021-08-24 11:55:59 +01:00
SChernykh
05d336c8e9 Update block_cache.cpp 2021-08-24 12:45:11 +02:00
SChernykh
1cf4071f9b BlockCache (Linux version) 2021-08-24 12:36:59 +02:00
SChernykh
bf5db3db08 Update p2pool.cpp 2021-08-24 12:01:43 +02:00
SChernykh
3229909333 Update p2pool.cpp 2021-08-24 11:59:59 +02:00
SChernykh
9808685981 Update stratum_server.cpp 2021-08-24 11:51:11 +02:00
SChernykh
aba3bc50b8 Block cache WIP and other fixes
- Block cache is implemented only on Windows for now
- Tracking of background jobs
- More robust sidechain syncing
2021-08-24 11:42:41 +02:00
SChernykh
86b31ea821 Reduce broadcast spam after initial sync 2021-08-24 00:27:48 +02:00
SChernykh
25ef5733a7 Skip duplicates in the saved peers list 2021-08-23 23:12:52 +02:00
SChernykh
fda80e3556 Sanity check 2021-08-23 23:09:59 +02:00
SChernykh
6d3cfa2c7a Couple more sanity checks 2021-08-23 23:08:46 +02:00
SChernykh
656f912a3e Workaround for crashes on shutdown 2021-08-23 22:50:36 +02:00
SChernykh
c4d3f6f8b4 Fixed parse_address_list() 2021-08-23 22:24:26 +02:00
SChernykh
2f08a35ac7 Fixed logger thread start/stop logic 2021-08-23 17:36:17 +02:00
SChernykh
df52838433 Removed some noisy warning messages 2021-08-23 14:05:07 +02:00
SChernykh
39a8c68ab7 More clang fixes 2021-08-23 11:44:26 +02:00
SChernykh
4a5691e349 clang fixes 2021-08-23 11:31:16 +02:00
SChernykh
510b7dbb85 Add files 2021-08-22 12:20:59 +02:00