message: wallet: Add missing BlockUntilSyncedToCurrentChain
diff: @@ -4388,6 +4388,11 @@ static RPCHelpMan walletprocesspsbt()
  std::shared_ptr<CWallet> const pwallet = GetWalletForJSONRPCRequest(request);
  if (!pwallet) return NullUniValue;
  + const CWallet& wallet{*pwallet};
  + // Make sure the results are valid at least up to the most recent block
  + // the user could have gotten from another RPC command prior to now
  + wallet.BlockUntilSyncedToCurrentChain();
  +
  RPCTypeCheck(request.params, {UniValue::VSTR, UniValue::VBOOL, UniValue::VSTR});
  // Unserialize the transaction
  @@ -4404,7 +4409,7 @@ static RPCHelpMan walletprocesspsbt()
  bool sign = request.params[1].isNull() ? true : request.params[1].get_bool();
  bool bip32derivs = request.params[3].isNull() ? true : request.params[3].get_bool();
  bool complete = true;
  - const TransactionError err = pwallet->FillPSBT(psbtx, complete, nHashType, sign, bip32derivs);
  + const TransactionError err{wallet.FillPSBT(psbtx, complete, nHashType, sign, bip32derivs)};
  if (err != TransactionError::OK) {
  throw JSONRPCTransactionError(err);
  }
  @@ -4503,6 +4508,11 @@ static RPCHelpMan walletcreatefundedpsbt()
  std::shared_ptr<CWallet> const pwallet = GetWalletForJSONRPCRequest(request);
  if (!pwallet) return NullUniValue;
  + CWallet& wallet{*pwallet};
  + // Make sure the results are valid at least up to the most recent block
  + // the user could have gotten from another RPC command prior to now
  + wallet.BlockUntilSyncedToCurrentChain();
  +
  RPCTypeCheck(request.params, {
  UniValue::VARR,
  UniValueType(), // ARR or OBJ, checked later
  @@ -4520,7 +4530,7 @@ static RPCHelpMan walletcreatefundedpsbt()
  // Automatically select coins, unless at least one is manually selected. Can
  // be overridden by options.add_inputs.
  coin_control.m_add_inputs = rawTx.vin.size() == 0;
  - FundTransaction(*pwallet, rawTx, fee, change_position, request.params[4], coin_control);
  + FundTransaction(wallet, rawTx, fee, change_position, request.params[4], coin_control);
  // Make a blank psbt
  PartiallySignedTransaction psbtx(rawTx);
  @@ -4528,7 +4538,7 @@ static RPCHelpMan walletcreatefundedpsbt()
  // Fill transaction with out data but don't sign
  bool bip32derivs = request.params[5].isNull() ? true : request.params[5].get_bool();
  bool complete = true;
  - const TransactionError err = pwallet->FillPSBT(psbtx, complete, 1, false, bip32derivs);
  + const TransactionError err{wallet.FillPSBT(psbtx, complete, 1, false, bip32derivs)};
  if (err != TransactionError::OK) {
  throw JSONRPCTransactionError(err);
  }
  