I do not know of a patch, but variable difficulty is one of the things I have looked in to.
It did not appear that it would be that hard to implement.
I was thinking of a non-registered login where miners would use whatever payout address they want as the username and the password would be the difficulty the miner wanted.Perhaps coded like Bitparking pools (d=xx) anything else in the password field would just be ignored.
In the sever.c code it is fairly easy to find and enable/disable the password/username check and/or add whatever code you wanted to run at miner login.
/* password database authentication check */
pass_db = pwdb_lookup(user);
if (!pass_db || (strcmp(pass, pass_db) && *pass_db != '\0'))
goto out;
rc = true;
strncpy(username_out, user, 64);
username_out[64] = 0;
out:
free(pass_db);
free(bin);
free(t_type);
free(t_b64);
free(t_userpass);
return rc;
Perhaps a check to make sure the address is a valid address for the chain, then place the payout address in the pool_worker database along with the password(difficulty desired).
One could just as easy use a registered system and add a difficulty field to the pool_worker table.
Either way, the simplicity of the pushpool code, makes alterations easier then with some of the newer pool software.
Quick hint: if using the native blkmond for long poll trips, there are two places in the blkmond code that directly contain and use the "magic" number for the chain:
def got_data(self):
while True:
if len(self.recvbuf) < 4:
return
if self.recvbuf[:4] != "\xFC\xC1\xB7\xDC":
raise ValueError("got garbage %s" % repr(self.recvbuf))
if self.ver_recv < 209:
if len(self.recvbuf) < 4 + 12 + 4:
return
def send_message(self, message, pushbuf=False):
if self.state != "connected" and not pushbuf:
return
print "send %s" % repr(message)
command = message.command
data = message.serialize()
tmsg = "\xFC\xC1\xB7\xDC"
tmsg += command
tmsg += "\x00" * (12 - len(command))
tmsg += struct.pack("
I sometimes think that the pool software developers purposely bury things like "magic numbers" instead of having them defined in the config file in order to make it more of a "challenge" to adapt the software to other coins..
Some of the new daemons have a block notify feature that could be used to completely remove the need for a complex block monitor.
I also found this simple little block monitor quite useful:
#!/usr/bin/env python
from jsonrpc.authproxy import AuthServiceProxy
import sys
import os
access = AuthServiceProxy("http://RPCUSER:
[email protected]:8332")
blockcount = access.getblockcount()
from time import sleep
while(True):
newcount = access.getblockcount()
if newcount > blockcount:
os.system("killall -s SIGUSR1 pushpoold")
sys.stdout.write("B")
sys.stdout.flush()
blockcount = newcount
sleep(1)
else:
sleep(0.1)
Thanks to metonymous
Bitcointalk thread:
https://bitcointalksearch.org/topic/blkmond-lite-8797