Make sure we check wallet is available and unlocked for pegging

This commit is contained in:
Gregory Sanders 2017-01-13 13:51:42 -05:00
parent edaaa8b0f9
commit 324cdae046

View file

@ -2845,6 +2845,8 @@ UniValue sendtomainchain(const UniValue& params, bool fHelp)
LOCK2(cs_main, pwalletMain->cs_wallet);
EnsureWalletIsUnlocked();
CParentBitcoinAddress address(params[0].get_str());
if (!address.IsValid())
throw JSONRPCError(RPC_INVALID_ADDRESS_OR_KEY, "Invalid Bitcoin address");