Skip to content

Commit 35e4dea

Browse files
committed
REMOVEME: printing
1 parent fac4f53 commit 35e4dea

File tree

2 files changed

+11
-2
lines changed

2 files changed

+11
-2
lines changed

src/wallet/rpcwallet.cpp

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -353,8 +353,11 @@ static CTransactionRef SendMoney(CWallet * const pwallet, const CTxDestination &
353353
if (nValue <= 0)
354354
throw JSONRPCError(RPC_INVALID_PARAMETER, "Invalid amount");
355355

356-
if (nValue > curBalance[asset])
356+
if (nValue > curBalance[asset]) {
357+
LogPrintf("xxxfunds: %s, %s\n", nValue, curBalance[asset]);
358+
PrintAmountMap(curBalance);
357359
throw JSONRPCError(RPC_WALLET_INSUFFICIENT_FUNDS, "Insufficient funds");
360+
}
358361

359362
if (pwallet->GetBroadcastTransactions() && !g_connman) {
360363
throw JSONRPCError(RPC_CLIENT_P2P_DISABLED, "Error: Peer-to-peer functionality missing or disabled");
@@ -1012,6 +1015,9 @@ static UniValue sendmany(const JSONRPCRequest& request)
10121015

10131016
// Check funds
10141017
if (totalAmount > pwallet->GetLegacyBalance(ISMINE_SPENDABLE, nMinDepth)) {
1018+
LogPrintf("xxxfunds 2:\n");
1019+
PrintAmountMap(totalAmount);
1020+
PrintAmountMap(pwallet->GetLegacyBalance(ISMINE_SPENDABLE, nMinDepth));
10151021
throw JSONRPCError(RPC_WALLET_INSUFFICIENT_FUNDS, "Wallet has insufficient funds");
10161022
}
10171023

@@ -1036,8 +1042,10 @@ static UniValue sendmany(const JSONRPCRequest& request)
10361042
std::string strFailReason;
10371043
CTransactionRef tx;
10381044
bool fCreated = pwallet->CreateTransaction(vecSend, tx, change_keys, nFeeRequired, nChangePosRet, strFailReason, coin_control);
1039-
if (!fCreated)
1045+
if (!fCreated) {
1046+
LogPrintf("xxxfunds 3: \n");
10401047
throw JSONRPCError(RPC_WALLET_INSUFFICIENT_FUNDS, strFailReason);
1048+
}
10411049
CValidationState state;
10421050
if (!pwallet->CommitTransaction(tx, std::move(mapValue), {} /* orderForm */, change_keys, g_connman.get(), state)) {
10431051
strFailReason = strprintf("Transaction commit failed:: %s", FormatStateMessage(state));

src/wallet/wallet.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2804,6 +2804,7 @@ bool CWallet::CreateTransaction(const std::vector<CRecipient>& vecSend, CTransac
28042804
continue;
28052805
}
28062806
else {
2807+
LogPrintf("xxxfunds random\n");
28072808
strFailReason = _("Insufficient funds");
28082809
return false;
28092810
}

0 commit comments

Comments
 (0)