From 975f22bfa0caecbf4f7519fec907168ba50e0d4a Mon Sep 17 00:00:00 2001 From: Duke Date: Thu, 21 Mar 2024 11:30:34 -0400 Subject: [PATCH] Improve error message in z_sendmany if tx is estimated to be too large The previous error message was incorrect, it could be too many inputs or a combination of too many inputs and outputs and also did not report the estimated size. --- src/wallet/rpcwallet.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/wallet/rpcwallet.cpp b/src/wallet/rpcwallet.cpp index 51273a754..ec99d7516 100644 --- a/src/wallet/rpcwallet.cpp +++ b/src/wallet/rpcwallet.cpp @@ -5311,7 +5311,7 @@ UniValue z_sendmany(const UniValue& params, bool fHelp, const CPubKey& mypk) } txsize += CTXOUT_REGULAR_SIZE * taddrRecipients.size(); if (txsize > max_tx_size) { - throw JSONRPCError(RPC_INVALID_PARAMETER, strprintf("Too many outputs, size of raw transaction would be larger than limit of %d bytes", max_tx_size )); + throw JSONRPCError(RPC_INVALID_PARAMETER, strprintf("Size of raw transaction %d would be larger than limit of %d bytes", txsize, max_tx_size )); } // Minimum confirmations