Author

Topic: Questions around operation of bitcoin with no blocks and dns disabled.. (Read 284 times)

jr. member
Activity: 48
Merit: 17
Stuck in what way? Is the transaction in the mempool but not being mined? Or is it in one node's mempool but not the other's?

I solved it somehow Smiley . The only problem that I have now is that imagine I have only two peers on my machine and I send several bitcoins to the other in two separate transactions. but the I mine them manually. Only the last one gets confirmed and the other one remains in mempool, even If I mine several blocks, It would be still in mempool. Why is that happening ?

Sencondly, fallbackfee  estimation is not working for my chain, I have to set it manually. What could be the reason?

Link to my repository : https://github.com/chameleon1239/bitcoin.git

Thanks a lot
staff
Activity: 3458
Merit: 6793
Just writing some code
Thanks a lot. It was very helpful. Do you know why transactions between nodes get stuck in memory pool? It's like they are never sent to receiver.
Stuck in what way? Is the transaction in the mempool but not being mined? Or is it in one node's mempool but not the other's?
jr. member
Activity: 48
Merit: 17
Just two more questions.

1.What exactly is the use of "IsInitialBloackDownlaod()" in mining.cpp. For my chain which is pretty new, If I want to check the block template, the functions returns true and I get
Code:
error -10 : Bitcoin is downloading blocks.
Is it same for
This is to prevent people from mining when they are out of sync. If you mine when out of sync, then you can cause a chain fork.

2. What is nMinimumChainWork and how it is calculated initially ?
ChainWork is the sum of all of the difficulties of all of the blocks in the blockchain. nMinimumChainWork is the chainwork for a specific block and is used during the initial sync as a safety check.

3. When Bicoin gui starts up, It says I'm 5 weeks behind.I forked bitcoin completely disabled DNS seeds. There's no reason for it. Why I get the message?
DNS is completely unrelated to this whatsoever. DNS seeds are used for finding nodes to connect to. It has nothing to do with you being behind.

The message appears because the software thinks you are out of sync. The most recent block is 5 weeks old and the software is expecting there to be more recent blocks. It has no way of knowing that there are not more recent blocks, but it assumes that there is because in Bitcoin, blocks are still being produced when you are offline.

Thanks a lot. It was very helpful. Do you know why transactions between nodes get stuck in memory pool? It's like they are never sent to receiver.
jr. member
Activity: 48
Merit: 17

What version are you testing with.

In v0.5.1 there is the above line in main.cpp might be helpful.

I'm using 0.16.2. I reduced coinbase maturity to 10 blocks for testing.
hero member
Activity: 1220
Merit: 612
OGRaccoon
Code:
const int nInitialBlockThreshold = 120; // Regard blocks up until N-threshold as "initial download"

What version are you testing with.

In v0.5.1 there is the above line in main.cpp might be helpful.
staff
Activity: 3458
Merit: 6793
Just writing some code
Just two more questions.

1.What exactly is the use of "IsInitialBloackDownlaod()" in mining.cpp. For my chain which is pretty new, If I want to check the block template, the functions returns true and I get
Code:
error -10 : Bitcoin is downloading blocks.
Is it same for
This is to prevent people from mining when they are out of sync. If you mine when out of sync, then you can cause a chain fork.

2. What is nMinimumChainWork and how it is calculated initially ?
ChainWork is the sum of all of the difficulties of all of the blocks in the blockchain. nMinimumChainWork is the chainwork for a specific block and is used during the initial sync as a safety check.

3. When Bicoin gui starts up, It says I'm 5 weeks behind.I forked bitcoin completely disabled DNS seeds. There's no reason for it. Why I get the message?
DNS is completely unrelated to this whatsoever. DNS seeds are used for finding nodes to connect to. It has nothing to do with you being behind.

The message appears because the software thinks you are out of sync. The most recent block is 5 weeks old and the software is expecting there to be more recent blocks. It has no way of knowing that there are not more recent blocks, but it assumes that there is because in Bitcoin, blocks are still being produced when you are offline.
jr. member
Activity: 48
Merit: 17
Just two more questions.

1.What exactly is the use of "IsInitialBloackDownlaod()" in mining.cpp. For my chain which is pretty new, If I want to check the block template, the functions returns true and I get
Code:
error -10 : Bitcoin is downloading blocks.
Is it same for

2. What is nMinimumChainWork and how it is calculated initially ?

3. When Bicoin gui starts up, It says I'm 5 weeks behind.I forked bitcoin completely disabled DNS seeds. There's no reason for it. Why I get the message?
jr. member
Activity: 48
Merit: 17
Thank you so much for the reply.

What client are you using?
I'm using the original Bitcoin Client but forked the source code. 

If you're using the original Bitcoin client (or its fork) to mine, you can manually include transactions into the blocks. Check if the mempool of the mining node lists that specific transaction you're trying to include.
It lists that specific transaction and highlights it with red. But how should I add it ?
jr. member
Activity: 48
Merit: 17
Did you change the coinbase maturity?

Yes, I reduced it to ten blocks for fast mining.I mines them within a second now.
legendary
Activity: 3038
Merit: 4418
Crypto Swap Exchange
1. I created two peers on same machine and I want to add them both to the block chain(The first one is already up). Is it enough to add address of first node to the config file of second node or I need to add both address to the each other's config file ?
Just one is enough, node connection are bi-directional and both nodes sends and receive information.
2. Should all nodes when created, mine blocks till at least their coinbase maturity?With two nodes on same machine I have to at least generate blocks till their coinbase maturity otherwise I can't spend any amount. It didn't make sense to me. Is it true with bitcoin chain itself ? Cause difficulty there is very high!!!
It's true with most/all coins. Orphan chains happens pretty often and it doesn't make sense for the coinbase maturity to be zero or small; the coins that would've otherwise been spent several times could turn out to be invalid. It would result in a relatively easy double spend (accidential or not). Bitcoin's coinbase maturity is 100 blocks but most mining pools absorbs the risks and rewards their miners at 6 confirmations as orphans that are greater than that rarely happens, if any at all.
3. First thing I do when a node starts up is that I generate a new address for it by
Code:
getnewaddress
command in console.Before typing this command there should be some automatically generated address assigned to the node or account. How can I get it?
There should be a keypool to your wallet. The getnewaddress doesn't generate addresses on the fly but rather it just reveals an address from the keypool each time you use the commands.
4. After mining enough blocks, I try to send some bitcoins to the other node,
Code:
sendtoaddress
but the coins wont't transfer and stays in memory pool for forever. Since I increased the target and reduced difficulty, this shouldn't happen. I guess my coins get lost or something....
What client are you using? If you're using the original Bitcoin client (or its fork) to mine, you can manually include transactions into the blocks. Check if the mempool of the mining node lists that specific transaction you're trying to include.
hero member
Activity: 1220
Merit: 612
OGRaccoon
Did you change the coinbase maturity?

You need to wait For each input to be confirmed,

if the referenced output transaction is coinbase (i.e. only 1 input, with hash=0, n=-1), it must have at least COINBASE_MATURITY (100) confirmations before it can be spent.

If you wanted to change your coinbase maturity period it can be found in main.h

Code:
static const int COINBASE_MATURITY = 100;
jr. member
Activity: 48
Merit: 17
While working on my private chain which is based on bitcoin. Several questions came to my mind. They maybe basic questions but so confusing for me.

1. I created two peers on same machine and I want to add them both to the block chain(The first one is already up). Is it enough to add address of first node to the config file of second node or I need to add both address to the each other's config file ?

2. Should all nodes when created, mine blocks till at least their coinbase maturity?With two nodes on same machine I have to at least generate blocks till their coinbase maturity otherwise I can't spend any amount. It didn't make sense to me. Is it true with bitcoin chain itself ? Cause difficulty there is very high!!!

3. First thing I do when a node starts up is that I generate a new address for it by
Code:
getnewaddress
command in console.Before typing this command there should be some automatically generated address assigned to the node or account. How can I get it?

4. After mining enough blocks, I try to send some bitcoins to the other node,
Code:
sendtoaddress
but the coins wont't transfer and stays in memory pool for forever. Since I increased the target and reduced difficulty, this shouldn't happen. I guess my coins get lost or something....

Does any one knows the answer?

Thank you so much.
Jump to: