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.
501}503const bool enable_send{!wallet().privateKeysDisabled() || wallet().hasExternalSigner()};504const bool always_show_unsigned{getOptionsModel()->getEnablePSBTControls()};505auto confirmationDialog = new SendConfirmationDialog(tr("Confirm fee bump"), questionString, "", "", SEND_CONFIRM_DELAY, enable_send, always_show_unsigned, nullptr);506confirmationDialog->setAttribute(Qt::WA_DeleteOnClose);507// TODO: Replace QDialog::exec() with safer QDialog::show().508const auto retval = static_cast<QMessageBox::StandardButton>(confirmationDialog->exec());510// cancel sign&broadcast if user doesn't want to bump the fee511if (retval != QMessageBox::Yes && retval != QMessageBox::Save) {512return false;513}515// Short-circuit if we are returning a bumped transaction PSBT to clipboard516if (retval == QMessageBox::Save) {517// "Create Unsigned" clicked518PartiallySignedTransaction psbtx(mtx);519bool complete = false;520const auto err{wallet().fillPSBT({.sign = false, .bip32_derivs = true}, nullptr, psbtx, complete)};521if (err || complete) {522QMessageBox::critical(nullptr, tr("Fee bump error"), tr("Can't draft transaction."));523return false;524}525// Serialize the PSBT526DataStream ssTx{};527ssTx << psbtx;528GUIUtil::setClipboard(EncodeBase64(ssTx.str()).c_str());529Q_EMIT message(tr("PSBT copied"), tr("Fee-bump PSBT copied to clipboard"), CClientUIInterface::MSG_INFORMATION | CClientUIInterface::MODAL);530return true;531}533WalletModel::UnlockContext ctx(requestUnlock());534if (!ctx.isValid()) {535return false;536}538assert(!m_wallet->privateKeysDisabled() || wallet().hasExternalSigner());540// sign bumped transaction541if (!m_wallet->signBumpTransaction(mtx)) {542QMessageBox::critical(nullptr, tr("Fee bump error"), tr("Can't sign transaction."));543return false;544}545// commit the bumped transaction546if(!m_wallet->commitBumpTransaction(hash, std::move(mtx), errors, new_hash)) {547QMessageBox::critical(nullptr, tr("Fee bump error"), tr("Could not commit transaction") + "<br />(" +548QString::fromStdString(errors[0].translated)+")");549return false;550}551return true;552}554void WalletModel::displayAddress(std::string sAddress) const555{556CTxDestination dest = DecodeDestination(sAddress);557try {558util::Result<void> result = m_wallet->displayAddress(dest);559if (!result) {560QMessageBox::warning(nullptr, tr("Signer error"), QString::fromStdString(util::ErrorString(result).translated));561}562} catch (const std::runtime_error& e) {563QMessageBox::critical(nullptr, tr("Can't display address"), e.what());564}565}567bool WalletModel::isWalletEnabled()568{569return !gArgs.GetBoolArg("-disablewallet", DEFAULT_DISABLE_WALLET);570}572QString WalletModel::getWalletName() const573{574return QString::fromStdString(m_wallet->getWalletName());575}577QString WalletModel::getDisplayName() const578{579return GUIUtil::WalletDisplayName(getWalletName());580}582bool WalletModel::isMultiwallet() const583{584return m_node.walletLoader().getWallets().size() > 1;585}587void WalletModel::refresh(bool pk_hash_only)588{589addressTableModel = new AddressTableModel(this, pk_hash_only);590}592uint256 WalletModel::getLastBlockProcessed() const593{594return m_client_model ? m_client_model->getBestBlockHash() : uint256{};595}597CAmount WalletModel::getAvailableBalance(const CCoinControl* control)598{599// No selected coins, return the cached balance600if (!control || !control->HasSelected()) {601const interfaces::WalletBalances& balances = getCachedBalance();602return balances.balance;603}604// Fetch balance from the wallet, taking into account the selected coins605return wallet().getAvailableBalance(*control);606}
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.