Merge pull request #119 from instagibbs/ensurewallet

Make sure we check wallet is available and unlocked for pegging
This commit is contained in:
Gregory Sanders 2017-02-07 11:09:27 -05:00 committed by GitHub
commit b16e7fbb48

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");