From b9a0aea3f5b27bb4c81bc82293c63c15edecf0e3 Mon Sep 17 00:00:00 2001 From: woodser Date: Tue, 16 Jul 2019 17:55:09 -0400 Subject: [PATCH] check if request cannot be fulfilled due to splitting --- src/wallet/MoneroWallet.cpp | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/src/wallet/MoneroWallet.cpp b/src/wallet/MoneroWallet.cpp index c9a35d8..46a5c61 100644 --- a/src/wallet/MoneroWallet.cpp +++ b/src/wallet/MoneroWallet.cpp @@ -1569,13 +1569,10 @@ namespace monero { cout << "CREATED " << ptx_vector.size() << " PENDING TXS" << endl; if (ptx_vector.empty()) throw runtime_error("No transaction created"); - // TODO: test send() (canSplit=false) checks for 1 and rejects -// // reject proposed transactions if there are more than one. see on_transfer_split below. -// if (ptx_vector.size() != 1) { -// er.code = WALLET_RPC_ERROR_CODE_TX_TOO_LARGE; -// er.message = "Transaction would be too large. try /transfer_split."; -// return false; -// } + // check if request cannot be fulfilled due to splitting + if (request.canSplit != boost::none && request.canSplit.get() == false && ptx_vector.size() != 1) { + throw runtime_error("Transaction would be too large. Try sendSplit()"); + } // config for fill_response() bool getTxKeys = true;