message: fix qa test blocking for gettransaction
diff: @@ -2337,16 +2337,25 @@ UniValue gettransaction(const JSONRPCRequest& request_)
  waitconf = request.params[2].get_int();
  }
  + bool shouldWaitConf = request.params.size() > 2 && waitconf > 0;
  +
  {
  LOCK2(cs_main, pwalletMain->cs_wallet);
  if (!pwalletMain->mapWallet.count(hash))
  throw JSONRPCError(RPC_INVALID_ADDRESS_OR_KEY, "Invalid or non-wallet transaction id");
  }
  - // FIXME: can i avoid long-poll if waitconf == 0 ?
  - request.PollStart();
  -
  CWalletTx* _wtx = NULL;
  +
  + // avoid long-poll if API caller does not specify waitconf
  + if (!shouldWaitConf) {
  + {
  + LOCK2(cs_main, pwalletMain->cs_wallet);
  + _wtx = &pwalletMain->mapWallet[hash];
  + }
  +
  + } else {
  + request.PollStart();
  while (true) {
  {
  LOCK2(cs_main, pwalletMain->cs_wallet);
  @@ -2366,6 +2375,8 @@ UniValue gettransaction(const JSONRPCRequest& request_)
  return NullUniValue;
  }
  }
  + }
  +
  LOCK2(cs_main, pwalletMain->cs_wallet);
  CWalletTx& wtx = *_wtx;
  