Skip to content

Instantly share code, notes, and snippets.

Created May 22, 2019 00:20
What would you like to do?
function handleConfigure(message){
var extensions = message.params[0];
var extensionParameters = message.params[1];
var poolRollingMask = 0x1fffe000;
// extensions is a list of extension codes defined in BIP310
// extensionParameters is a dict of parameters for each extension code
if (extensions.indexOf('version-rolling') != -1) {
var minerMask = "0x" + extensionParameters['version-rolling.mask'];
var minBitCount = extensionParameters['version-rolling.min-bit-count'];
var poolMask = parseInt(poolRollingMask, 16);
var userMask = parseInt(minerMask, 16);
sendJson({id:, result: {'version-rolling': true, 'version-rolling.mask': poolMask & userMask}, error: false})
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment