Skip to content

Commit

Permalink
Make sure we check wallet is available and unlocked for pegging
Browse files Browse the repository at this point in the history
  • Loading branch information
instagibbs committed Feb 3, 2017
1 parent edaaa8b commit 324cdae
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/wallet/rpcwallet.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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");
Expand Down

0 comments on commit 324cdae

Please sign in to comment.