message: Disallow sendtoaddress and sendmany when private keys disabled
diff: @@ -393,6 +393,12 @@ UniValue SendMoney(CWallet* const pwallet, const CCoinControl &coin_control, std
  EnsureWalletIsUnlocked(pwallet);
  if (fWalletUnlockMintOnly)
  throw JSONRPCError(RPC_WALLET_ERROR, "Error: Wallet unlocked for block minting only, unable to create transaction.");
  + // This function is only used by sendtoaddress and sendmany.
  + // This should always try to sign, if we don't have private keys, don't try to do anything here.
  + if (pwallet->IsWalletFlagSet(WALLET_FLAG_DISABLE_PRIVATE_KEYS)) {
  + throw JSONRPCError(RPC_WALLET_ERROR, "Error: Private keys are disabled for this wallet");
  + }
  +
  // Shuffle recipient list
  std::shuffle(recipients.begin(), recipients.end(), FastRandomContext());
  @@ -402,7 +408,7 @@ UniValue SendMoney(CWallet* const pwallet, const CCoinControl &coin_control, std
  bilingual_str error;
  CTransactionRef tx;
  FeeCalculation fee_calc_out;
  - bool fCreated = pwallet->CreateTransaction(recipients, tx, nFeeRequired, nChangePosRet, error, coin_control, fee_calc_out, !pwallet->IsWalletFlagSet(WALLET_FLAG_DISABLE_PRIVATE_KEYS));
  + const bool fCreated = pwallet->CreateTransaction(recipients, tx, nFeeRequired, nChangePosRet, error, coin_control, fee_calc_out, true);
  if (!fCreated) {
  throw JSONRPCError(RPC_WALLET_INSUFFICIENT_FUNDS, error.original);
  }
  