message: Refactor some importprunedfunds checks with guard clause
  Credit to jkczyz
diff: @@ -363,12 +363,12 @@ UniValue importprunedfunds(const JSONRPCRequest& request)
  //Search partial merkle tree in proof for our transaction and index in valid block
  std::vector<uint256> vMatch;
  std::vector<unsigned int> vIndex;
  - unsigned int txnIndex = 0;
  - Optional<int> height;
  - if (merkleBlock.txn.ExtractMatches(vMatch, vIndex) == merkleBlock.header.hashMerkleRoot) {
  + if (merkleBlock.txn.ExtractMatches(vMatch, vIndex) != merkleBlock.header.hashMerkleRoot) {
  + throw JSONRPCError(RPC_INVALID_ADDRESS_OR_KEY, "Something wrong with merkleblock");
  + }
  auto locked_chain = pwallet->chain().lock();
  - height = locked_chain->getBlockHeight(merkleBlock.header.GetHash());
  + Optional<int> height = locked_chain->getBlockHeight(merkleBlock.header.GetHash());
  if (height == nullopt) {
  throw JSONRPCError(RPC_INVALID_ADDRESS_OR_KEY, "Block not found in chain");
  }
  @@ -378,16 +378,11 @@ UniValue importprunedfunds(const JSONRPCRequest& request)
  throw JSONRPCError(RPC_INVALID_ADDRESS_OR_KEY, "Transaction given doesn't exist in proof");
  }
  - txnIndex = vIndex[it - vMatch.begin()];
  - }
  - else {
  - throw JSONRPCError(RPC_INVALID_ADDRESS_OR_KEY, "Something wrong with merkleblock");
  - }
  + unsigned int txnIndex = vIndex[it - vMatch.begin()];
  CWalletTx::Confirmation confirm(CWalletTx::Status::CONFIRMED, *height, merkleBlock.header.GetHash(), txnIndex);
  wtx.m_confirm = confirm;
  - auto locked_chain = pwallet->chain().lock();
  LOCK(pwallet->cs_wallet);
  if (pwallet->IsMine(*wtx.tx)) {
  