RPC: sending 0 amount is invalid with state blocks

This commit is contained in:
SergiySW 2018-11-26 12:36:29 +03:00 committed by Lee Bousfield
commit 99f3221bc6

View file

@ -2762,6 +2762,11 @@ void rai::rpc_handler::send ()
rpc_control_impl ();
auto wallet (wallet_impl ());
auto amount (amount_impl ());
// Sending 0 amount is invalid with state blocks
if (!ec && amount.is_zero ())
{
ec = nano::error_common::invalid_amount;
}
if (!ec)
{
std::string source_text (request.get<std::string> ("source"));