From 324cdae046d04d6a90c3bf7d99cffe74d948ae55 Mon Sep 17 00:00:00 2001 From: Gregory Sanders Date: Fri, 13 Jan 2017 13:51:42 -0500 Subject: [PATCH] Make sure we check wallet is available and unlocked for pegging --- src/wallet/rpcwallet.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/wallet/rpcwallet.cpp b/src/wallet/rpcwallet.cpp index 41805f7f87..d1f0781cb9 100644 --- a/src/wallet/rpcwallet.cpp +++ b/src/wallet/rpcwallet.cpp @@ -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");