@@ -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));
0 commit comments