5

The code you're looking for is in CreateNewBlock. The usual way transactions are added to a block is by sorting by priority. The priority of an input is the value being spent in the input multiplied by the number of confirmations it has. The priority of a transaction is the sum of all the priorities of the inputs. See this line: dPriority += (double)...


4

you can find explanation here: https://bitcointalk.org/index.php?topic=5095376.msg49150302#msg49150302 the issue was actually with OP_RETURN. What OP_RETURN used to do is it would skip to the end of the script so whatever was on the stack was interpreted for the final script result. So what you could do was create a scriptSig that was just OP_TRUE ...


3

The code you're citing does not actually deal with difficulty. It deals with targets. The target is the maximum 256-bit value than the block hash is allowed to have. The difficulty is defined as 2^208 * 65535 / target. As for the book, that looks wrong indeed.


3

According to your debug.log file, txindex is not enabled: 2018-04-22 20:40:34 LoadBlockIndexDB: transaction index disabled This indicates that your bitcoin.conf is incorrect. Make sure that your bitcoin.conf file's full filename is actually bitcoin.conf (not bitcoin.conf.txt or with some other extension).


1

Mh i'm try with Bitcoin android wallet and work, this is the result Can be your wallet have a bug?


1

I think the arrow from HMAC-SHA256 should point right to the child public key. Am I right?? No, there are 3 derivation functions defined in BIP32 - Hierarchical Deterministic Wallets Private parent key → private child key Public parent key → public child key Private parent key → public child key The diagram above illustrates 1. Private ...


1

This is indeed an error in the book: https://github.com/bitcoinbook/bitcoinbook/issues/440 See this diff for the correct steps.


1

Seems to me that ... creating a Pay-to-Witness-Script-Hash (P2WSH) output that would look like this: 0 9592d601848d04b172905e0ddb0adde59f1590f1e553ffc81ddc4b0ed927dd73... means that this hash is an example not derived from the data above


1

There are 2^256 possible hashes and your source gives a target value of 238348*2^176, requiring more than 60 bits of leading zeros (61 in fact, plus the slightly stricter requirement that a valid hash must be smaller than the target value and not just start with the same number of leading zeros). In fact, the fraction of acceptable hashes out of all possible ...


Only top voted, non community-wiki answers of a minimum length are eligible