add empty container sanity checks when using front() and back()

This commit is contained in:
moneromooo-monero 2017-12-11 22:36:58 +00:00
parent 56fa6ce15f
commit 45a1c4c088
No known key found for this signature in database
GPG key ID: 686F07454D6CEFC3
9 changed files with 32 additions and 6 deletions

View file

@ -602,6 +602,13 @@ namespace tools
uint64_t mixin = m_wallet->adjust_mixin(req.mixin);
std::vector<wallet2::pending_tx> ptx_vector = m_wallet->create_transactions_2(dsts, mixin, req.unlock_time, req.priority, extra, req.account_index, req.subaddr_indices, m_trusted_daemon);
if (ptx_vector.empty())
{
er.code = WALLET_RPC_ERROR_CODE_TX_NOT_POSSIBLE;
er.message = "No transaction created";
return false;
}
// reject proposed transactions if there are more than one. see on_transfer_split below.
if (ptx_vector.size() != 1)
{