Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 5942085
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 22, 20262026-05-22T16:12:06+00:00 2026-05-22T16:12:06+00:00

Here is a small snippet of a program i am trying to understand, but

  • 0

Here is a small snippet of a program i am trying to understand, but can’t understand due to pointers.

/* issue JSON-RPC request */
val = json_rpc_call(curl, srv.rpc_url, srv.rpc_userpass, s);
if (!val) {
    fprintf(stderr, "submit_work json_rpc_call failed\n");
    goto out;
}

*json_result = json_is_true(json_object_get(val, "result"));
rc = true;

sharelog(remote_host, auth_user,
     srv.easy_target ? "Y" : *json_result ? "Y" : "N",
     *json_result ? "Y" : "N", NULL, hexstr);

if (debugging > 1)
    applog(LOG_INFO, "[%s] PROOF-OF-WORK submitted upstream.  "
           "Result: %s",
           remote_host,
           *json_result ? "TRUE" : "false");

json_decref(val);

if (*json_result)
    applog(LOG_INFO, "PROOF-OF-WORK found");

/* if pool server mode, return success even if result==false */
if (srv.easy_target)
    *json_result = true;

out:
return rc;

My concern is this part:

/* if pool server mode, return success even if result==false */
if (srv.easy_target)
    *json_result = true;

In my case srv.easy_target is true. Then json_result will be true as well, however that if statement is placed at the end of the function. I just don’t understand how json_result would be of use.
Or is the pointer going to pass that even before any of the code above is executed?

Basically how will that pointer placed at the end of the function be of any use?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-22T16:12:07+00:00Added an answer on May 22, 2026 at 4:12 pm

    json_result is a pointer, probably a parameter from outside. Using * dereferences it and changes the value it points to.

    That is a pretty standard way of providing results from functions. The caller passes a pointer to its variable, and the callee does exactly what this code does: dereferences the passed pointer and changes the value it points to, thus changing the caller’s variable.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Here is a small snippet from a C# program to generate dictionary from file.
Here a small snippet of code that returns epsilon() for a real value: program
Here is a small program showing a problem: import Data.Fixed main = do print
I'm having a small issue here: <div id=navbar> <ul id=navtabs class=floatcontainer> <li <?php if
I am stuck with a small problem here.. What i am trying to do
I've a small issue here. I am using an if statement with UIAlertView and
i have a small problem here which i cannot fix,This post goes through but
Small design question here. I'm trying to develop a calculation app in C#. I
Okay so here's my small snippet of code: base.$el.delegate('.mb-panel', 'hover', base.hover = function(){ base.change(
I have a small program that which is confusing me. I am trying using

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.