With the provided code snippet, the getNotificationResponse function will now include additional logic to handle the "mining.notify" response differently based on the stratum mode. For regular stratum mode (EthProxy), it will return the initial response with "EthereumStratum/1.0.0" and the extranonce. For NiceHash stratum mode, it will construct the response using data from the current block template (t) and return the appropriate response for NiceHash miners.
Please note that the getNotificationResponse function is used in the handleTCPMessage function when handling "mining.subscribe" requests for NiceHash mode. Make sure the rest of the code is properly set up to handle NiceHash stratum mode based on your specific requirements.
Remember to integrate this code into your existing Go codebase and test it thoroughly to ensure it works as expected. If you have any further questions or need additional assistance, feel free to ask!
// DeleteOldMinerData deletes old miner data from the "miner" ZSets.
// All entries that are older than 24 hours are removed.
// DeleteOldShareData deletes old share data from the "share" ZSets.
// All entries that are older than 24 hours are removed.
// GetMinerCharts retrieves miner charts from Redis and returns them as []*MinerCharts.
// The hashNum parameter determines the maximum number of items to retrieve from the leaderboard.
// The login parameter is used as the key to access the leaderboard.
// The function also supports optional arguments that can be used to perform deletion operations on the leaderboard.
// If the deleteCount argument value is 0, all items in the leaderboard older than 24 hours are removed.
// Otherwise, the first deleteCount items are removed from the leaderboard.
// The result is a slice of MinerCharts objects representing the retrieved charts.
// In case of an error, an error object is returned.
// window defines the duration after which the statistics become stale.
// largeWindow defines the duration after which the statistics are permanently deleted.