UNOMP / node-merged-pool

High performance Stratum poolserver in Node.js
GNU General Public License v2.0
77 stars 119 forks source link

Add Dash 0.12.1 support #5

Closed schinzelh closed 7 years ago

schinzelh commented 7 years ago

This pull request adds compatibility for the new Dash 0.12.1 getblocktemplate (GBT) - it is a backport of https://github.com/dashpay/node-stratum-pool/pull/1

===

A normal GBT looks like this now

{
  "capabilities": [
    "proposal"
  ],
  "version": 536870912,
  "previousblockhash": "000000209742f8df6f781aade59f6b001ec15ffbd03acd42634e39c48a7d7985",
  "transactions": [
  ],
  "coinbaseaux": {
    "flags": ""
  },
  "coinbasevalue": 2250000000,
  "longpollid": "000000209742f8df6f781aade59f6b001ec15ffbd03acd42634e39c48a7d7985803",
  "target": "0000004713360000000000000000000000000000000000000000000000000000",
  "mintime": 1481619810,
  "mutable": [
    "time",
    "transactions",
    "prevblock"
  ],
  "noncerange": "00000000ffffffff",
  "sigoplimit": 20000,
  "sizelimit": 1000000,
  "curtime": 1481620526,
  "bits": "1d471336",
  "height": 118406,
  "masternode": {
    "payee": "yRpfg9tR9cirJa9E8Gh4T8q1WfctUTaUte",
    "script": "76a9143c5f662726fde41e4e67ffcd285b40b602d3730188ac",
    "amount": 1125000000
  },
  "masternode_payments_started": true,
  "masternode_payments_enforced": false,
  "superblock": [
  ],
  "superblocks_started": true,
  "superblocks_enabled": true
}

while a superblock GBT looks like this:

{
  "capabilities": [
    "proposal"
  ],
  "version": 536870912,
  "previousblockhash": "0000004d66b9379159d1cce94ac70d85eea6744643659e971b484371d14079f6",
  "transactions": [
  ],
  "coinbaseaux": {
    "flags": ""
  },
  "coinbasevalue": 8250000000,
  "longpollid": "0000004d66b9379159d1cce94ac70d85eea6744643659e971b484371d14079f678",
  "target": "0000008e45000000000000000000000000000000000000000000000000000000",
  "mintime": 1481531989,
  "mutable": [
    "time", 
    "transactions", 
    "prevblock"
  ],
  "noncerange": "00000000ffffffff",
  "sigoplimit": 20000,
  "sizelimit": 1000000,
  "curtime": 1481532617,
  "bits": "1e008e45",
  "height": 117840,
  "masternode": {
  },
  "masternode_payments_started": true,
  "masternode_payments_enforced": false,
  "superblock": [
    {
      "payee": "yhhApcCJbe8635NicwKRLoJQ9yyjx8cpeJ",
      "script": "76a914ea7669dd0d9331ab4e70c29a3f8a508ee8e3d61088ac",
      "amount": 5000000000
    }, 
    {
      "payee": "yegdXWqxJihYmbD575SQh75N3a37SJfHkz",
      "script": "76a914c973e9a595c44414892471736baa82dcc3020d0788ac",
      "amount": 1000000000
    }
  ],
  "superblocks_started": true,
  "superblocks_enabled": true
}