Browse Source

Fixed bug with coinbase timestamp

Sometimes coinbase timestamp was newer than block timestamp which caused rejected blocks.
peercoin
Intel 11 years ago
parent
commit
e281ca4a3d
  1. 3
      src/server/poolserver/NetworkMgr/NetworkMgr.cpp

3
src/server/poolserver/NetworkMgr/NetworkMgr.cpp

@ -63,6 +63,9 @@ void NetworkMgr::UpdateBlockTemplate()
BinaryData pubkey = Util::ASCIIToBin(sConfig.Get<std::string>("MiningAddress")); BinaryData pubkey = Util::ASCIIToBin(sConfig.Get<std::string>("MiningAddress"));
block->tx.push_back(Bitcoin::CreateCoinbaseTX(_blockHeight, pubkey, response["coinbasevalue"].GetInt(), Util::ASCIIToBin("D7PoolBeta"))); block->tx.push_back(Bitcoin::CreateCoinbaseTX(_blockHeight, pubkey, response["coinbasevalue"].GetInt(), Util::ASCIIToBin("D7PoolBeta")));
// Fix nTime for coinbase tx
block->tx[0].time = block->time;
// Add other transactions // Add other transactions
JSON trans = response["transactions"]; JSON trans = response["transactions"];
for (uint64 tidx = 0; tidx < trans.Size(); ++tidx) { for (uint64 tidx = 0; tidx < trans.Size(); ++tidx) {

Loading…
Cancel
Save