Files

49 lines
1.5 KiB
C++
Raw Permalink Normal View History

2017-11-09 19:34:51 +01:00
/*
* This file is part of the Flowee project
* Copyright (C) 2009-2010 Satoshi Nakamoto
* Copyright (C) 2009-2015 The Bitcoin Core developers
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#include "MutableBlock.h"
2013-04-13 00:13:08 -05:00
#include "hash.h"
2014-08-20 10:51:18 +02:00
#include "tinyformat.h"
#include "utilstrencodings.h"
#include "crypto/common.h"
uint256 BlockHeaderFields::createHash() const
2013-06-25 03:03:03 +02:00
{
return SerializeHash(*this);
2013-06-25 03:03:03 +02:00
}
#if 0
2021-11-02 09:36:09 +01:00
std::string MutableBlock::toString() const
2013-06-25 03:03:03 +02:00
{
2014-08-20 10:26:27 +02:00
std::stringstream s;
s << strprintf("MutableBlock(hash=%s, ver=%d, hashPrevBlock=%s, hashMerkleRoot=%s, nTime=%u, nBits=%08x, nNonce=%u, vtx=%u)\n",
2021-11-02 09:28:35 +01:00
createHash().ToString(),
2013-06-25 03:03:03 +02:00
nVersion,
2014-01-16 16:15:27 +01:00
hashPrevBlock.ToString(),
hashMerkleRoot.ToString(),
2013-06-25 03:03:03 +02:00
nTime, nBits, nNonce,
vtx.size());
for (unsigned int i = 0; i < vtx.size(); i++) {
2014-08-20 10:26:27 +02:00
s << " " << vtx[i].ToString() << "\n";
2013-06-25 03:03:03 +02:00
}
2014-08-20 10:26:27 +02:00
return s.str();
2013-06-25 03:03:03 +02:00
}
#endif