pooler / cpuminer

CPU miner for Litecoin and Bitcoin
https://bitcointalk.org/index.php?topic=55038.0
Other
2.77k stars 1.21k forks source link

"Block does not start with a coinbase" on a Bitcoin altcoin #179

Closed Forst closed 4 years ago

Forst commented 5 years ago

Hello!

This is probably a server-side issue, but looking up online gave zero clues, wondered if you could hint me at what might be wrong.

Running a Bitcoin Core-based altcoin on localhost:8332 and trying to set up cpuminer to mine for it. cpuminer successfully fetches work, yet when it submits calculated blocks, the server rejects them with this:

{"result":null,"error":{"code":-22,"message":"Block does not start with a coinbase"},"id":1}

Running the miner with the following arguments:

./minerd -q -a sha256d -R 5 -o http://localhost:8332/ -O mylogin:mypass --coinbase-addr="<34-char address>"

Uploaded the packet capture with the HTTP exchange, if it helps: traffic.pcap.gz.

Any help is greatly appreciated, thank you in advance!


EDIT: retrieved data for the previous block to the one being mined, in case it helps.

000000209fecbf08351be7a806db917246d3137caf6a8707c2939907d9d2304e02000000ef903021cddc71eb2a334e93aae3d780c0f4a314b5ea2fb38d6776daf4e5d7902ea0c85c9d75061d075100000000000001020000000001010000000000000000000000000000000000000000000000000000000000000000ffffffff0602de1a020a01ffffffff0200e40b54020000001976a9142794b302df5f6ed17a8402c8fe749af758b1cf3b88ac0000000000000000266a24aa21a9ede2f61c3f71d1defd3fa999dfa36953755c690689799962b48bebd836974e8cf901200000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
{
  "hash": "000000018a526130cfdcb74e6b752ac0ddb0b8f1d72ad586508fb4155501adac",
  "confirmations": 5880,
  "strippedsize": 231,
  "size": 267,
  "weight": 960,
  "height": 6878,
  "version": 536870912,
  "versionHex": "20000000",
  "merkleroot": "90d7e5f4da76678db32feab514a3f4c080d7e3aa934e332aeb71dccd213090ef",
  "tx": [
    "90d7e5f4da76678db32feab514a3f4c080d7e3aa934e332aeb71dccd213090ef"
  ],
  "time": 1556652078,
  "mediantime": 1556652043,
  "nonce": 20743,
  "bits": "1d06759d",
  "difficulty": 0.154810134057757,
  "chainwork": "00000000000000000000000000000000000000000000000000000291d9ba15b0",
  "nTx": 1,
  "nChain": 0,
  "previousblockhash": "000000024e30d2d9079993c207876aaf7c13d3467291db06a8e71b3508bfec9f",
  "nextblockhash": "000000044b74673d6aa939c9109d3b1e9f4233e230acecfc9e548cbac097b9f4"
}

EDIT 2: I may be wrong, but it looks like the nonce field is 8 bytes instead of 4 in this altcoin, causing the whole block structure to shift compared to the original Bitcoin. Wonder if the miner can be adapted to a different nonce field size?

pooler commented 4 years ago

Not currently interested in adding support for alternative block header formats, sorry.

imtotoh commented 3 years ago

facing similar issue. did anyone found a solution ?