Please check the whole question once before giving negative marking or Mark as duplicate of
Why can’t the genesis block coinbase be spent?
Why I cannot get transaction from genesis block [duplicate]
I am creating AltCoin from litecoin source.And using GenesisHO generating genesis block details like nonce ,genesis hash , merkle etc.
While generating genesis block I have changed the coin value parameters in genesis coin value. that is -v
parameters and generated genesis hash and merkle etc.
I've done changes regarding genesis , nonce, coins for genesis block.
genesis = CreateGenesisBlock(1538404994, 2086003386, 0x1e0ffff0, 1, 50000 * COIN);
eg. I want to premine 50,000 coins in genesis block. I don't want give condition in validation.cpp like if block height 1 than reward should be 50,000.
I've generated pub key and used the same pub key while generating genesis hash.So I can use that genesis block coins by importing private key of that pub key.
After all above change in source,I've build daemon ,cli ,tx and qt from same source.
Next
From cli I have executed command(coin-cli generate 1
) to generate one block so I can get genesis block coin(Yes!! initially it will be in immature state after x(which I've set to 1) amount of block it will be in mature state). And imported that private key in wallet.
Result of above :
After execution of coin-cli generate 1
genesis coins are generated.Displayed in wallet and account under account name ""
Started Mining (using cpuminer) which has another account's address. And after few blocks genesis block coins converted to mature state
Problem/Issue
Now when i tried to transfer from that genesis block coins its not transferring to any address.Its not displaying in qt wallet but using cli command its displaying balance.
So where do I need to make other changes to make that genesis coin spendable.
Transactions details
Balance details from qt wallet and command
Litecoin source : https://github.com/litecoin-project/litecoin/tree/0.14
UPDATE
I've tried & follow steps from this answer too After updating as per from above answer in validation.cpp here is the link of same
Update 2
Changes mentioned in answer regarding validation.cpp & updated validation.cpp file here & same updated change mentioned below line wise
Changes for assert(pindex->pprev);
Added WriteUndoDataForBlock method :
Change to skip writing undo data for genesis block
After updating above things it give error Segmentation fault (core dumped)
Thanks.
validation.cpp
, specifically this line? github.com/litecoin-project/litecoin/blob/0.14/src/…assert(pindex->pprev)
. All the changes you need to make are in that file.