Stack Exchange Network

Stack Exchange network consists of 174 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.

Visit Stack Exchange

Questions tagged [source-code]

The tag has no usage guidance.

1
vote
0answers
31 views

What is the best way to test new consensus protocol?

I wanted to test a new consensus protocol. However, the bitcoin core is a large codebase (>100k lines). Is there any small codebase which is designed to test new consensus protocols and includes only ...
0
votes
1answer
37 views

Is it true that only one message can be sent at a time in Bitcoin Core?

I looked into Bitcoin Core client code, and it seems that there is a lock that allows only one thread to send data (Block, TX, etc.) at a given time point. If this is true, it means that transactions ...
1
vote
0answers
24 views

What is the behavior of the try catch statement in lines 1707-1729 in the ui.cpp in the release 0.1?

In the first public release, ui.cpp has this code on the lines in the subject: void CSendingDialog::OnReply3(CDataStream& vRecv) { int nRet; try { vRecv >> nRet; ...
1
vote
2answers
59 views

Bitcoind does not like ECDSA (r, s) pair produced by OpenSSL

I am writing transactions manually and have stumbled across a rather bizarre situation. Only one in a few of the transactions I broadcast to bitcoind is accepted, otherwise I get a REJECT_NONSTANDARD ...
3
votes
1answer
38 views

How is bitcoind “shy” when exchanging `version` packets?

This is more of a technical/programming question. I am referring to this line of code: https://github.com/bitcoin/bitcoin/blob/be992701b018f256db6d64786624be4cb60d8975/src/net_processing.cpp#L1699 ...
1
vote
1answer
47 views

Where in the source code are transaction validation checks implemented?

I understand that consensus (mining) and transaction validation are different concepts. Correct me if I'm wrong, but I believe each full node validates transactions and puts the valid ones into its ...
17
votes
1answer
1k views

How does the most recently found critical vulnerability (CVE-2018-17144) work?

If you were a miner, what are the steps you would take to create the extra (21,000,012.5th) bitcoin? Where in the source code is this exactly (link)? Why can't this be done by a non-miner? Also, ...
0
votes
0answers
9 views

Where does bitcoin handle merkleblock messages?

I'm trying to understand the internals of bitcoin itself, and have deciphered a number of the peer-to-peer messages, but I'm having a hard time tracing where bitcoin handles the MerkleBlock message, ...
1
vote
1answer
27 views

why 'extern' was used in the noui.h file?

When i review the source code, i find that the noui.h is a header file, but the method noui_connect has been declared by key words 'extern'. i think there is no need to do this. extern void ...
1
vote
1answer
28 views

Bitcoin Code and Transaction Model [closed]

I'm Studying bitcoin from a while, focusing transaction model and I'm looking to extract transaction model only to try out some experiments to make the structure better from the current one. If anyone ...
0
votes
2answers
44 views

When are blocks validated?

Are blocks validated just before they are stored to memory, upon receipt from an RPC submit call, or at some other time? Can you point to the place in code where this validation process begins? Is ...
0
votes
1answer
76 views

Debugging Bitcoin Unit Tests

I am running the unit tests from bitcoin source using make check, and would like to debug the tests using LogPrint in the bitcoin source files. I read in the Test Docs that logs are only output to ...
1
vote
0answers
25 views

Are there any blockchain implementations that are not based on the Bitcoin source code?

I wanted to code up a blockchain from scratch using C++. So I got around to looking at some existing blockchain source code to get some ideas. But all I can find is the Bitcoin source or forks of it. ...
0
votes
1answer
81 views

Which file is the source codes of regtest net located?

I try to compare the source codes between main net and regtest net of bitcoin. I am not sure where the source codes of regtest located. Would someone help me, please?
0
votes
0answers
26 views

Altcoins based on bitcoin 0.3 source code?

Are there any altcoins based on the bitcoin source code which used the bitcoin client version 0.3 and are still using that code?
1
vote
0answers
39 views

How to compile newest source and find merkleRoot hash value?

I am following youtube video for make own coin. I did below 4 lines command for compile newest bitcoin source. ./autogen.sh ./configure make sudo make install And run ./mycoind file at src/ ...
0
votes
1answer
205 views

Bitcoin Source Code genesisOutputScript

I am checking bitcoin source code to learn forking a coin better, in this link https://github.com/bitcoin/bitcoin/blob/master/src/chainparams.cpp Line 52 has scratched my mind, what is that for? ...
2
votes
1answer
211 views

(Shouldn't be too hard) Where vanitygen checks if the random address starts with the expected pattern?

I've been trying the find the code in Vanitygen that does checks whether the generated address starts with the expected pattern. Vanitygen repo: https://github.com/samr7/vanitygen What I currently ...
0
votes
2answers
106 views

What are seeds in the source code of bitcoin?

https://github.com/bitcoin/bitcoin/blob/master/src/chainparams.cpp starting from line 132, I see the function vSeeds.emplace_back("seed.bitcoin.") and next to them there are real full names. What do ...
1
vote
1answer
371 views

BTC Source code amount.h file

I have question about the source code, under src/amount.h I see the max coin supply being 21.000.000 (million) under the variable called MAX_MONEY. I want to ask what other variables mean, CAmount ...
0
votes
1answer
3k views

How to Create New Genesis Block?

I am trying to create a new crypto currency and i am struggling with creating genesis block with the bitcoin code. I am following this tutorial https://bitcointalk.org/index.php?topic=225690.0 and i ...
0
votes
1answer
41 views

What are the most historic code changes on bitcoin core?

I was looking through the pull requests on bitcoin core's github and was looking for some of the major changes to the code. https://github.com/bitcoin/bitcoin/pulls?page=10&q=is%3Apr+is%3Aopen ...
1
vote
0answers
53 views

Altering blockinfo to include valid nonce and extraNonce's in the miner_tests

I currently work on upgrading an old cryptocurrency (fork of an old bitcoin version) to the latest of Bitcoin that includes a lot of tests. I currently am stuck with making this test succeed: https://...
8
votes
2answers
710 views

In 2009, where were Bitcoin source codes stored?

Now I can see the Bitcoin Core source code in Github but I wonder where the original source code of Bitcoin were stored back in 2009? Was it managed under SVN? How did contributors or programmers work ...
0
votes
1answer
229 views

What is consensus.BIP34Height? [duplicate]

In the bitcoin source code, I am looking at chainparams.cpp. I can see on line 81 something called consensus.BIP34Height? What is that? I can't figure out what this is. I'm not sure what else to ask ...
0
votes
0answers
86 views

issue in forking bitcoin 0.12 and internal miner

For education purposes(preparing online course) I am working on a bitcoin fork which enables the cpu mining. By looking in internet i've learned that internal miner was removed from bitcoin codebase ...
0
votes
1answer
85 views

Definition of `Idx`

idx is an integer in source code of bitcoin related softwares. https://github.com/decred/atomicswap/blob/70f795e/cmd/btcatomicswap/main.go#L391 https://github.com/btcsuite/btcd/blob/...
1
vote
1answer
350 views

Where's the code related to block 494784 for segwit2x?

I read everywhere that segwit2x activates at blocks 494784, around 15 or 16 of November. I did just checkout the segwit2x codebase doing: git clone https://github.com/btc1/bitcoin And I can see ...
0
votes
1answer
99 views

What is 999999999999ULL

I am building an altcoin based on bitcoin 0.12, in chainparams we find : consensus.vDeployments[Consensus::DEPLOYMENT_TESTDUMMY].nStartTime = 0; consensus.vDeployments[Consensus::...
2
votes
0answers
110 views

Clarification of some getaddr() function inputs and outputs

In the Bitcoin system to discover new nodes, each node communicates with its peers by sending getaddr() to the peers. Based on the bitcoin implementation: //! the maximum percentage of nodes to ...
1
vote
2answers
2k views

How create / generate a coinbase transaction for a new block?

I am coding a miner program with C, and right now I need some info of how create / generate a coinbase transaction to add to the block before submit it to the bitcoin network. Someone can indicate any ...
1
vote
1answer
268 views

Bitcoin difficulty re targeting in case of catastrophic hashrate drop?

I do understand that the mining difficulty changes every 2016 blocks : next_difficulty = (previous_difficulty * 2016 * 10 minutes) / (time to mine last 2016 blocks) But how is difficulty changes if ...
1
vote
1answer
297 views

Why did Satoshi not choose for Segwit?

I know that the very early version of the Bitcoin code had a lot of advanced features, and was already very mature. But Segwit (storing signatures separately from the transactions in the block) is a ...