LostSoulfly / MinerProxy

Ethereum Stratum Mining Proxy - Replace all Wallets with your own. Claymore/EWBF proxy. Miner Proxy.
77 stars 36 forks source link

Donate only % #18

Open kmsgoat opened 6 years ago

kmsgoat commented 6 years ago

I want to donate only % to people who are taking care of my rigs. However changes like these are not working: `case "mining.submit":

                        if (redirector.thisMiner.submittedShares % 25 == 0)
                        {
                            madeChanges = true;

                            dyn.@params[0] = "WORKERSWALLET";

                            string tempBuffer = JsonConvert.SerializeObject(dyn, Formatting.None) + "\n";

                            newBuffer = Encoding.UTF8.GetBytes(tempBuffer);
                            newLength = tempBuffer.Length;

                            Newtonsoft.Json.Linq.JValue val = dyn.@params[0];
                            string wallet = val.Value.ToString();

                                lock (Logger.ConsoleBlockLock)
                                {
                                    Logger.LogToConsole("Old Wallet: " + redirector.thisMiner.replacedWallet, redirector.thisMiner.endPoint, ConsoleColor.Yellow);
                                    Logger.LogToConsole("New Wallet: " + wallet, redirector.thisMiner.endPoint, ConsoleColor.Yellow);
                                }
                        }`

I am talking about ZEC. If you could assist me I would be grateful.

LostSoulfly commented 6 years ago

I'm not sure how it would work changing the wallet occasionally. I haven't attempted that. MinerProxy only redirects the mining software's built in "fee" to the wallet of your choice by default.

You could try something like this:

        int percent = 25;
        Random rnd = new Random(Guid.NewGuid().GetHashCode());
        double chance = rnd.Next(0, 100);

        if (chance <= percent) {
        //change the wallet
        }

And have it send the wallet you want to mine to with the submitted share. I don't know whether the pool would accept that or not, but it's worth a try. I don't know a lot about the protocol of ZEC, to be honest. From memory, I think it only sends the wallet at login and not with every share, but I could be wrong.

kmsgoat commented 6 years ago

Yeah I've tried that, haven't managed to actually do it. It looks like it doesn't change the packet at all for me.

I think it send wallet at submit share as well, I'll check that.

LostSoulfly commented 6 years ago

@kmsgoat Did you ever get this working? I'm interested in the results.