C++ 如何在比特币克隆中每5000个区块创建coinbase支付
我正在尝试为比特币克隆创建一个语句,该语句每隔一定数量的区块执行coinbase支付,例如,每5000个区块向给定地址支付100枚硬币。最接近我的是:C++ 如何在比特币克隆中每5000个区块创建coinbase支付,c++,bitcoin,C++,Bitcoin,我正在尝试为比特币克隆创建一个语句,该语句每隔一定数量的区块执行coinbase支付,例如,每5000个区块向给定地址支付100枚硬币。最接近我的是: if(pindexBest->nHeight+1==5000){ std::map<std::string,int64> genesisBalances= getGenesisBalances(); std::map<std::string,int64>::iterator balit; i
if(pindexBest->nHeight+1==5000){
std::map<std::string,int64> genesisBalances= getGenesisBalances();
std::map<std::string,int64>::iterator balit;
int i=1;
int64 total=0;
txNew.vout.resize(genesisBalances.size()+1);
for(balit=genesisBalances.begin(); balit!=genesisBalances.end(); ++balit){
//printf("gb:%s,%llu",balit->first.c_str(),balit->second);
CBitcoinAddress address(balit->first);
txNew.vout[i].scriptPubKey.SetDestination( address.Get() );
txNew.vout[i].nValue = balit->second;
total=total+balit->second;
i++;
}
printf("Total ...%llu\n",total);
}
是它获取目标地址的位置。这样行吗
txNew.vout[i].scriptPubKey= "insertscriptpubkeyhere";
txNew.vout[i].scriptPubKey= "insertscriptpubkeyhere";