Author

Topic: higher difficulty acceptance from the node (Read 704 times)

legendary
Activity: 804
Merit: 1002
June 03, 2013, 09:55:35 AM
#8
ah. *cough*  I am reading the code from my tv. bad excuse. -.-
legendary
Activity: 2053
Merit: 1356
aka tonikt
I saw that, but then it seems that I understood it wrong. Proof of work means for me that it checks if the target is smaller than the last hash given. If I have a higher difficulty (and more leading zeroes) then it should be smaller than the last hash, or did I miss something?
Well in such case I think you probably only missed the lesson of C programming, where they were explaining the magic behind != symbol Wink
legendary
Activity: 804
Merit: 1002
I saw that, but then it seems that I understood it wrong. Proof of work means for me that it checks if the target is smaller than the last hash given. If I have a higher difficulty (and more leading zeroes) then it should be smaller than the last hash, or did I miss something?
legendary
Activity: 2053
Merit: 1356
aka tonikt
Were in AcceptBlock? It seems I can't find a check against it.

It's kind of hard to miss it, but well..

Code:
        // Check proof of work
        if (nBits != GetNextWorkRequired(pindexPrev, this))
            return state.DoS(100, error("AcceptBlock() : incorrect proof of work"));
legendary
Activity: 804
Merit: 1002
Were in AcceptBlock? It seems I can't find a check against it.
legendary
Activity: 2053
Merit: 1356
aka tonikt
If one artificially raises the difficulty of the block and finds a valid hash for the higher difficulty, would it get accepted by the node?
No.
It's in AcceptBlock function, in main.cpp
hero member
Activity: 836
Merit: 1030
bits of proof
difficulty is not number of leading zeros, but a threshold number the block hash has to be less.

A block might satisfy a difficulty higher than currently required, and that would be accepted by others. The difficulty for next block does however not raise with that, its just waste of effort (or luck).
legendary
Activity: 804
Merit: 1002
I searched around and found nothing in the forum, so here it is:

If one artificially raises the difficulty of the block and finds a valid hash for the higher difficulty, would it get accepted by the node?
Also, I can't wrap my head around the lesser difficulty in some mining pools. How are they accepted if they have lesser leading zeroes?
Jump to: