|
|
@ -12,11 +12,6 @@ std::string COutPoint::ToString() const |
|
|
|
return strprintf("COutPoint(%s, %u)", hash.ToString().substr(0,10), n); |
|
|
|
return strprintf("COutPoint(%s, %u)", hash.ToString().substr(0,10), n); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
void COutPoint::print() const |
|
|
|
|
|
|
|
{ |
|
|
|
|
|
|
|
LogPrintf("%s\n", ToString()); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
CTxIn::CTxIn(COutPoint prevoutIn, CScript scriptSigIn, unsigned int nSequenceIn) |
|
|
|
CTxIn::CTxIn(COutPoint prevoutIn, CScript scriptSigIn, unsigned int nSequenceIn) |
|
|
|
{ |
|
|
|
{ |
|
|
|
prevout = prevoutIn; |
|
|
|
prevout = prevoutIn; |
|
|
@ -46,11 +41,6 @@ std::string CTxIn::ToString() const |
|
|
|
return str; |
|
|
|
return str; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
void CTxIn::print() const |
|
|
|
|
|
|
|
{ |
|
|
|
|
|
|
|
LogPrintf("%s\n", ToString()); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
CTxOut::CTxOut(int64_t nValueIn, CScript scriptPubKeyIn) |
|
|
|
CTxOut::CTxOut(int64_t nValueIn, CScript scriptPubKeyIn) |
|
|
|
{ |
|
|
|
{ |
|
|
|
nValue = nValueIn; |
|
|
|
nValue = nValueIn; |
|
|
@ -67,11 +57,6 @@ std::string CTxOut::ToString() const |
|
|
|
return strprintf("CTxOut(nValue=%d.%08d, scriptPubKey=%s)", nValue / COIN, nValue % COIN, scriptPubKey.ToString().substr(0,30)); |
|
|
|
return strprintf("CTxOut(nValue=%d.%08d, scriptPubKey=%s)", nValue / COIN, nValue % COIN, scriptPubKey.ToString().substr(0,30)); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
void CTxOut::print() const |
|
|
|
|
|
|
|
{ |
|
|
|
|
|
|
|
LogPrintf("%s\n", ToString()); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
CFeeRate::CFeeRate(int64_t nFeePaid, size_t nSize) |
|
|
|
CFeeRate::CFeeRate(int64_t nFeePaid, size_t nSize) |
|
|
|
{ |
|
|
|
{ |
|
|
|
if (nSize > 0) |
|
|
|
if (nSize > 0) |
|
|
@ -92,8 +77,7 @@ int64_t CFeeRate::GetFee(size_t nSize) const |
|
|
|
|
|
|
|
|
|
|
|
std::string CFeeRate::ToString() const |
|
|
|
std::string CFeeRate::ToString() const |
|
|
|
{ |
|
|
|
{ |
|
|
|
std::string result = FormatMoney(nSatoshisPerK) + " BTC/kB"; |
|
|
|
return strprintf("%d.%08d BTC/kB", nSatoshisPerK / COIN, nSatoshisPerK % COIN); |
|
|
|
return result; |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
CMutableTransaction::CMutableTransaction() : nVersion(CTransaction::CURRENT_VERSION), nLockTime(0) {} |
|
|
|
CMutableTransaction::CMutableTransaction() : nVersion(CTransaction::CURRENT_VERSION), nLockTime(0) {} |
|
|
@ -171,11 +155,6 @@ std::string CTransaction::ToString() const |
|
|
|
return str; |
|
|
|
return str; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
void CTransaction::print() const |
|
|
|
|
|
|
|
{ |
|
|
|
|
|
|
|
LogPrintf("%s", ToString()); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// Amount compression:
|
|
|
|
// Amount compression:
|
|
|
|
// * If the amount is 0, output 0
|
|
|
|
// * If the amount is 0, output 0
|
|
|
|
// * first, divide the amount (in base units) by the largest power of 10 possible; call the exponent e (e is max 9)
|
|
|
|
// * first, divide the amount (in base units) by the largest power of 10 possible; call the exponent e (e is max 9)
|
|
|
@ -285,9 +264,10 @@ uint256 CBlock::CheckMerkleBranch(uint256 hash, const std::vector<uint256>& vMer |
|
|
|
return hash; |
|
|
|
return hash; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
void CBlock::print() const |
|
|
|
std::string CBlock::ToString() const |
|
|
|
{ |
|
|
|
{ |
|
|
|
LogPrintf("CBlock(hash=%s, ver=%d, hashPrevBlock=%s, hashMerkleRoot=%s, nTime=%u, nBits=%08x, nNonce=%u, vtx=%u)\n", |
|
|
|
std::stringstream s; |
|
|
|
|
|
|
|
s << strprintf("CBlock(hash=%s, ver=%d, hashPrevBlock=%s, hashMerkleRoot=%s, nTime=%u, nBits=%08x, nNonce=%u, vtx=%u)\n", |
|
|
|
GetHash().ToString(), |
|
|
|
GetHash().ToString(), |
|
|
|
nVersion, |
|
|
|
nVersion, |
|
|
|
hashPrevBlock.ToString(), |
|
|
|
hashPrevBlock.ToString(), |
|
|
@ -296,11 +276,11 @@ void CBlock::print() const |
|
|
|
vtx.size()); |
|
|
|
vtx.size()); |
|
|
|
for (unsigned int i = 0; i < vtx.size(); i++) |
|
|
|
for (unsigned int i = 0; i < vtx.size(); i++) |
|
|
|
{ |
|
|
|
{ |
|
|
|
LogPrintf(" "); |
|
|
|
s << " " << vtx[i].ToString() << "\n"; |
|
|
|
vtx[i].print(); |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
LogPrintf(" vMerkleTree: "); |
|
|
|
s << " vMerkleTree: "; |
|
|
|
for (unsigned int i = 0; i < vMerkleTree.size(); i++) |
|
|
|
for (unsigned int i = 0; i < vMerkleTree.size(); i++) |
|
|
|
LogPrintf("%s ", vMerkleTree[i].ToString()); |
|
|
|
s << " " << vMerkleTree[i].ToString(); |
|
|
|
LogPrintf("\n"); |
|
|
|
s << "\n"; |
|
|
|
|
|
|
|
return s.str(); |
|
|
|
} |
|
|
|
} |
|
|
|