From 15c83ac6b41db135ac7d7005116cf9968563a39d Mon Sep 17 00:00:00 2001 From: Simon Date: Sun, 4 Sep 2016 19:08:12 -0700 Subject: [PATCH] Remove redundant check when getting spending key for a payment address. --- src/wallet/asyncrpcoperation_sendmany.cpp | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/src/wallet/asyncrpcoperation_sendmany.cpp b/src/wallet/asyncrpcoperation_sendmany.cpp index 45a4164a2..1016501c3 100644 --- a/src/wallet/asyncrpcoperation_sendmany.cpp +++ b/src/wallet/asyncrpcoperation_sendmany.cpp @@ -59,10 +59,6 @@ AsyncRPCOperation_sendmany::AsyncRPCOperation_sendmany( PaymentAddress addr = address.Get(); // We don't need to lock on the wallet as spending key related methods are thread-safe - if (!pwalletMain->HaveSpendingKey(addr)) { - throw JSONRPCError(RPC_INVALID_ADDRESS_OR_KEY, "Invalid from address, should be a taddr or zaddr."); - } - SpendingKey key; if (!pwalletMain->GetSpendingKey(addr, key)) { throw JSONRPCError(RPC_INVALID_ADDRESS_OR_KEY, "Invalid from address, no spending key found for zaddr"); @@ -71,8 +67,8 @@ AsyncRPCOperation_sendmany::AsyncRPCOperation_sendmany( isfromzaddr_ = true; frompaymentaddress_ = addr; spendingkey_ = key; - } catch (std::runtime_error) { - throw JSONRPCError(RPC_INVALID_ADDRESS_OR_KEY, "Invalid from address, should be a taddr or zaddr."); + } catch (std::runtime_error e) { + throw JSONRPCError(RPC_INVALID_ADDRESS_OR_KEY, string("runtime error: ") + e.what()); } } }