Author

Topic: [Solved+Fix] Issue with mined coins of my altcoin (Read 301 times)

legendary
Activity: 1161
Merit: 1004
[SOLVED+FIX]

I've managed to fix the issue by enabling CPU miner to read the PS2H prefix by editing util.c of CPU miner:

https://github.com/pooler/cpuminer/blob/master/util.c#L674

Change that value according to your SCRIPT_ADDRESS in chainparams.cpp of your coin's source code:

https://github.com/bitcoin/bitcoin/blob/master/src/chainparams.cpp#L141

Re-compile the CPU miner and run it. This is gonna be the success result:

legendary
Activity: 1161
Merit: 1004
It looks like ToNdTui9QonxKutQA9W3rVTocwXYbUndf9 is script address (P2SH) and TQ32UoQrhdL5WUkK8jAjNNC1zSGbt7zQXw is pubkey address (P2PKH).
What I don't understand is why cpuminer is sending the mined coins to that pubkey address and not to the script address I entered in coinbase-addr parameter?
legendary
Activity: 1161
Merit: 1004
I'm facing a problem with my own altcoin when mining new blocks, I do not receive any mined coin to my coinbase address and of course Bitcoin Core keeps displaying me 0 BTC balance.

Setup:
Forked Bitcoin Core v0.16.0 (stable version), generated genesis block, reduced COINBASE_MATURITY from 100 to 1, changed PUBKEY_ADDRESS to 65 ('T') and SCRIPT_ADDRESS to 66 (alternative 'T', PS: I'm aware it looks confusing/weird especially in such test cases).

CPU Miner:
Code:
-O test:1234 -o http://127.0.0.1:15621/ --coinbase-addr=ToNdTui9QonxKutQA9W3rVTocwXYbUndf9 -a sha256d -D --no-longpoll --no-getwork --no-stratum

The block explorer I setup (bitcoin-abe) shows the mined coins are being forwarded to some unknown address TQ32UoQrhdL5WUkK8jAjNNC1zSGbt7zQXw not owned by me.

Block #1:


[click here for full screen image]



Coinbase Transaction:


[click here for full screen image]



ToNdTui9QonxKutQA9W3rVTocwXYbUndf9:


[click here for full screen image]



TQ32UoQrhdL5WUkK8jAjNNC1zSGbt7zQXw:


[click here for full screen image]
Jump to: