Skip to content

Commit

Permalink
Merge pull request #119 from instagibbs/ensurewallet
Browse files Browse the repository at this point in the history
Make sure we check wallet is available and unlocked for pegging
  • Loading branch information
instagibbs committed Feb 7, 2017
2 parents edaaa8b + 324cdae commit b16e7fb
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 b16e7fb

Please sign in to comment.