Inside Bitcoin
Opening the selected file…
Inside Bitcoin
Opening the selected file…
The code behind the network, with room to understand it.
Release published 2026-10-28 · Snapshot fetched 2026-11-01. Latest stable release at fetch time; development branches and Git history are excluded. Only the selected code window and visible folders load here.
251// Mixed debit transaction252//253auto mine = wtx.txin_is_mine.begin();254for (const CTxIn& txin : wtx.tx->vin) {255if (*(mine++)) {256strHTML += "<b>" + tr("Debit") + ":</b> " + BitcoinUnits::formatHtmlWithUnit(unit, -wallet.getDebit(txin)) + "<br>";257}258}259mine = wtx.txout_is_mine.begin();260for (const CTxOut& txout : wtx.tx->vout) {261if (*(mine++)) {262strHTML += "<b>" + tr("Credit") + ":</b> " + BitcoinUnits::formatHtmlWithUnit(unit, wallet.getCredit(txout)) + "<br>";263}264}265}266}268strHTML += "<b>" + tr("Net amount") + ":</b> " + BitcoinUnits::formatHtmlWithUnit(unit, nNet, true) + "<br>";270//271// Message272//273if (wtx.message) {274strHTML += "<br><b>" + tr("Message") + ":</b><br>" + GUIUtil::HtmlEscape(*wtx.message, true) + "<br>";275}276if (wtx.comment) {277strHTML += "<br><b>" + tr("Comment") + ":</b><br>" + GUIUtil::HtmlEscape(*wtx.comment, true) + "<br>";278}280strHTML += "<b>" + tr("Transaction ID") + ":</b> " + rec->getTxHash() + "<br>";281strHTML += "<b>" + tr("Transaction total size") + ":</b> " + QString::number(wtx.tx->ComputeTotalSize()) + " bytes<br>";282strHTML += "<b>" + tr("Transaction virtual size") + ":</b> " + QString::number(GetVirtualTransactionSize(*wtx.tx)) + " bytes<br>";283strHTML += "<b>" + tr("Output index") + ":</b> " + QString::number(rec->getOutputIndex()) + "<br>";285// Message from normal bitcoin:URI (bitcoin:123...?message=example)286for (const std::string& msg : messages) {287strHTML += "<br><b>" + tr("Message") + ":</b><br>" + GUIUtil::HtmlEscape(msg, true) + "<br>";288}289// BIP 70 Payment Requests290for (const std::string& req : payment_requests) {291QString merchant;292if (!GetPaymentRequestMerchant(req, merchant)) {293merchant.clear();294} else {295merchant = tr("%1 (Certificate was not verified)").arg(merchant);296}297if (!merchant.isNull()) {298strHTML += "<b>" + tr("Merchant") + ":</b> " + GUIUtil::HtmlEscape(merchant) + "<br>";299}300}302if (wtx.is_coinbase)303{304quint32 numBlocksToMaturity = COINBASE_MATURITY + 1;305strHTML += "<br>" + tr("Generated coins must mature %1 blocks before they can be spent. When you generated this block, it was broadcast to the network to be added to the block chain. If it fails to get into the chain, its state will change to \"not accepted\" and it won't be spendable. This may occasionally happen if another node generates a block within a few seconds of yours.").arg(QString::number(numBlocksToMaturity)) + "<br>";306}308//309// Debug view310//311if (node.getLogCategories() != BCLog::NONE)312{313strHTML += "<hr><br>" + tr("Debug information") + "<br><br>";314for (const CTxIn& txin : wtx.tx->vin)315if(wallet.txinIsMine(txin))316strHTML += "<b>" + tr("Debit") + ":</b> " + BitcoinUnits::formatHtmlWithUnit(unit, -wallet.getDebit(txin)) + "<br>";317for (const CTxOut& txout : wtx.tx->vout)318if(wallet.txoutIsMine(txout))319strHTML += "<b>" + tr("Credit") + ":</b> " + BitcoinUnits::formatHtmlWithUnit(unit, wallet.getCredit(txout)) + "<br>";321strHTML += "<br><b>" + tr("Transaction") + ":</b><br>";322strHTML += GUIUtil::HtmlEscape(wtx.tx->ToString(), true);324strHTML += "<br><b>" + tr("Inputs") + ":</b>";325strHTML += "<ul>";327for (const CTxIn& txin : wtx.tx->vin)328{329COutPoint prevout = txin.prevout;331if (auto prev{node.getUnspentOutput(prevout)}) {332{333strHTML += "<li>";334const CTxOut& vout = prev->out;335CTxDestination address;336if (ExtractDestination(vout.scriptPubKey, address))337{338std::string name;339if (wallet.getAddress(address, &name, /*purpose=*/nullptr) && !name.empty())340strHTML += GUIUtil::HtmlEscape(name) + " ";341strHTML += QString::fromStdString(EncodeDestination(address));342}343strHTML = strHTML + " " + tr("Amount") + "=" + BitcoinUnits::formatHtmlWithUnit(unit, vout.nValue);344strHTML = strHTML + " IsMine=" + (wallet.txoutIsMine(vout) ? tr("true") : tr("false")) + "</li>";345}346}347}349strHTML += "</ul>";350}352strHTML += "</font></html>";353return strHTML;354}
Independent explanations by MyBitcoinExplorer. Not affiliated with or endorsed by Bitcoin Core. Guides are educational and do not replace the source or its tests.
Bitcoin Core source © its contributors, distributed under the MIT license. Original notices and bundled third-party licenses are retained in the source tree.