| 406 | } |
| 407 | |
| 408 | static bool CreateStableCoinGenesisBlock(std::unique_ptr<CBlock> &pBlock) { |
| 409 | LOCK(cs_main); |
| 410 | |
| 411 | // Create block reward transaction. |
| 412 | pBlock->vptx.push_back(std::make_shared<CBlockRewardTx>()); |
| 413 | |
| 414 | // Create stale coin genesis transactions. |
| 415 | SysCfg().CreateFundCoinMintTx(pBlock->vptx, SysCfg().NetworkID()); |
| 416 | |
| 417 | // Fill in header |
| 418 | CBlockIndex *pIndexPrev = chainActive.Tip(); |
| 419 | int32_t height = pIndexPrev->height + 1; |
| 420 | uint32_t fuelRate = GetElementForBurn(pIndexPrev); |
| 421 | |
| 422 | pBlock->SetPrevBlockHash(pIndexPrev->GetBlockHash()); |
| 423 | pBlock->SetNonce(0); |
| 424 | pBlock->SetHeight(height); |
| 425 | pBlock->SetFuel(0); |
| 426 | pBlock->SetFuelRate(fuelRate); |
| 427 | |
| 428 | return true; |
| 429 | } |
| 430 | |
| 431 | static bool CreateNewBlockForStableCoinRelease(int64_t startMiningMs, Miner &miner, CCacheWrapper &cwIn, std::unique_ptr<CBlock> &pBlock) { |
| 432 | pBlock->vptx.push_back(std::make_shared<CUCoinBlockRewardTx>()); |
no test coverage detected