Skip to content

Commit 8bba91b

Browse files
committed
[wallet] Fix whitespace in CWallet::CommitTransaction()
Reviewer hint: use --ignore-all-space git diff option for review.
1 parent c34b886 commit 8bba91b

File tree

1 file changed

+26
-31
lines changed

1 file changed

+26
-31
lines changed

src/wallet/wallet.cpp

Lines changed: 26 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -3291,45 +3291,40 @@ bool CWallet::CreateTransaction(interfaces::Chain::Lock& locked_chain, const std
32913291
*/
32923292
bool CWallet::CommitTransaction(CTransactionRef tx, mapValue_t mapValue, std::vector<std::pair<std::string, std::string>> orderForm, CValidationState& state)
32933293
{
3294-
{
3295-
auto locked_chain = chain().lock();
3296-
LOCK(cs_wallet);
3294+
auto locked_chain = chain().lock();
3295+
LOCK(cs_wallet);
32973296

3298-
CWalletTx wtxNew(this, std::move(tx));
3299-
wtxNew.mapValue = std::move(mapValue);
3300-
wtxNew.vOrderForm = std::move(orderForm);
3301-
wtxNew.fTimeReceivedIsTxTime = true;
3302-
wtxNew.fFromMe = true;
3297+
CWalletTx wtxNew(this, std::move(tx));
3298+
wtxNew.mapValue = std::move(mapValue);
3299+
wtxNew.vOrderForm = std::move(orderForm);
3300+
wtxNew.fTimeReceivedIsTxTime = true;
3301+
wtxNew.fFromMe = true;
33033302

3304-
WalletLogPrintf("CommitTransaction:\n%s", wtxNew.tx->ToString()); /* Continued */
3305-
{
3303+
WalletLogPrintf("CommitTransaction:\n%s", wtxNew.tx->ToString()); /* Continued */
33063304

3307-
// Add tx to wallet, because if it has change it's also ours,
3308-
// otherwise just for transaction history.
3309-
AddToWallet(wtxNew);
3305+
// Add tx to wallet, because if it has change it's also ours,
3306+
// otherwise just for transaction history.
3307+
AddToWallet(wtxNew);
33103308

3311-
// Notify that old coins are spent
3312-
for (const CTxIn& txin : wtxNew.tx->vin)
3313-
{
3314-
CWalletTx &coin = mapWallet.at(txin.prevout.hash);
3315-
coin.BindWallet(this);
3316-
NotifyTransactionChanged(this, coin.GetHash(), CT_UPDATED);
3317-
}
3318-
}
3309+
// Notify that old coins are spent
3310+
for (const CTxIn& txin : wtxNew.tx->vin) {
3311+
CWalletTx &coin = mapWallet.at(txin.prevout.hash);
3312+
coin.BindWallet(this);
3313+
NotifyTransactionChanged(this, coin.GetHash(), CT_UPDATED);
3314+
}
33193315

3320-
// Get the inserted-CWalletTx from mapWallet so that the
3321-
// fInMempool flag is cached properly
3322-
CWalletTx& wtx = mapWallet.at(wtxNew.GetHash());
3316+
// Get the inserted-CWalletTx from mapWallet so that the
3317+
// fInMempool flag is cached properly
3318+
CWalletTx& wtx = mapWallet.at(wtxNew.GetHash());
33233319

3324-
if (fBroadcastTransactions)
3325-
{
3326-
std::string err_string;
3327-
if (!wtx.SubmitMemoryPoolAndRelay(err_string, true, *locked_chain)) {
3328-
WalletLogPrintf("CommitTransaction(): Transaction cannot be broadcast immediately, %s\n", err_string);
3329-
// TODO: if we expect the failure to be long term or permanent, instead delete wtx from the wallet and return failure.
3330-
}
3320+
if (fBroadcastTransactions) {
3321+
std::string err_string;
3322+
if (!wtx.SubmitMemoryPoolAndRelay(err_string, true, *locked_chain)) {
3323+
WalletLogPrintf("CommitTransaction(): Transaction cannot be broadcast immediately, %s\n", err_string);
3324+
// TODO: if we expect the failure to be long term or permanent, instead delete wtx from the wallet and return failure.
33313325
}
33323326
}
3327+
33333328
return true;
33343329
}
33353330

0 commit comments

Comments
 (0)