Post
Topic
Board Development & Technical Discussion
Re: How to add premine in the bitcoin source
by
vanshtah
on 04/02/2020, 04:08:59 UTC
Hmm no confirmations, maybe because of the current value of MAX_MONEY (master/src/amount.h) which is equal to the maximum "mineable" coins.
The premine output exceeded the MAX_MONEY which makes those coinbase transactions with 1Billion BTC output invalid.

Updated that too

Code:
static const CAmount MAX_MONEY = 10000000000 * COIN;

Block 4 details

Code:
{
    "hash": "e8f6528f802bc3ada6d258983b6a573a2fe3534231d01c56defaac7040c0e926",
    "confirmations": 1478,
    "strippedsize": 216,
    "size": 216,
    "weight": 864,
    "height": 4,
    "version": 536870912,
    "versionHex": "20000000",
    "merkleroot": "c888967eedfb202a3f7f075c0a5602006dde4e153c40dea8742afccbb2ab4a70",
    "tx": "See 'Transaction IDs'",
    "time": 1580260378,
    "mediantime": 1580259876,
    "nonce": 55920,
    "bits": "1e0ffff0",
    "difficulty": 0.000244140625,
    "chainwork": "0000000000000000000000000000000000000000000000000000000000500050",
    "previousblockhash": "409c8ef479727dd5e183855ae7820042bfe7133b06e57f8810f4b6898a4a2711",
    "nextblockhash": "c8d0f2f55e7aaf21e8637d420556bb932281151d6f39741d6c499310f8185261",
    "coinbaseTx": {
        "txid": "c888967eedfb202a3f7f075c0a5602006dde4e153c40dea8742afccbb2ab4a70",
        "hash": "c888967eedfb202a3f7f075c0a5602006dde4e153c40dea8742afccbb2ab4a70",
        "version": 2,
        "size": 135,
        "vsize": 135,
        "locktime": 0,
        "vin": [
            {
                "coinbase": "540107",
                "sequence": 4294967295
            }
        ],
        "vout": [
            {
                "value": "1000000000.00000000",
                "n": 0,
                "scriptPubKey": {
                    "asm": "OP_DUP OP_HASH160 72563c4d79d5f410805691e233e5d4083f33a8cf OP_EQUALVERIFY OP_CHECKSIG",
                    "hex": "76a91472563c4d79d5f410805691e233e5d4083f33a8cf88ac",
                    "reqSigs": 1,
                    "type": "pubkeyhash",
                    "addresses": [
                        "ASCRz7q4RzWNjyZfD4Rrg214Y3CU57pa9v"
                    ]
                }
            },
            {
                "value": 0,
                "n": 1,
                "scriptPubKey": {
                    "asm": "OP_RETURN aa21a9ede2f61c3f71d1defd3fa999dfa36953755c690689799962b48bebd836974e8cf9",
                    "hex": "6a24aa21a9ede2f61c3f71d1defd3fa999dfa36953755c690689799962b48bebd836974e8cf9",
                    "type": "nulldata"
                }
            }
        ],
        "hex": "02000000010000000000000000000000000000000000000000000000000000000000000000ffffffff03540107ffffffff0200008a5d784563011976a91472563c4d79d5f410805691e233e5d4083f33a8cf88ac0000000000000000266a24aa21a9ede2f61c3f71d1defd3fa999dfa36953755c690689799962b48bebd836974e8cf900000000",
        "blockhash": "e8f6528f802bc3ada6d258983b6a573a2fe3534231d01c56defaac7040c0e926",
        "confirmations": 1478,
        "time": 1580260378,
        "blocktime": 1580260378
    },
    "totalFees": "999999950",
    "miner": null
}