-
Notifications
You must be signed in to change notification settings - Fork 4
POW and Minting
gc87 edited this page Aug 7, 2018
·
2 revisions
源文件 | 类 |
---|---|
miner.h、miner.cpp | CMinerWork、CMiner |
类 | 变量名称 | 类型 | 描述 |
---|---|---|---|
CMinerWork | vchWorkData | vector | 需要惊醒hash的工作量数据 |
hashPrev | uint256 | 前一区块的hash | |
nPrevTime | int64 | 前一区块的产生时间 | |
nAlgo | int | 算法标识,1:POWA_BLAKE512 | |
nBits | int | hash结果的长度 |
bool CMiner::GetWork()
{
"prevblockhash" : "17f820812707cf8c18f91a01054d28514c06bf7ddf604d9e33a766cc9e1b29a8",
"prevblocktime" : 1531419134,
"algo" : 1,
"bits" : 37,
"data" : "01000100309a475ba8291b9ecc66a7339e4d60df7dbf064c51284d05011af9188ccf07278120f8174300000000000000000000000000000000000000000000000000000000000000000001250000000000000000000000000000000000000000000000000000000000000000"
}
prevblockhash:前一区块的hash;
prevblocktime:前一区块的产生时间戳;
algo:hash算法标识;
bits:当前hash难度度量;
data:需要hash的数据;
以上数据每次获取并解析之后对CMiner.workCurrent的对应字段赋值,供后续POW算法使用。
bool CMiner::SubmitWork(const vector<unsigned char>& vchWorkData)
void CMiner::LaunchMiner()
整理者 | 日期 |
---|---|
Chun Gao | 2018.08.06 |
Home | Copyright © 2017-2019 FissionAndFusion