Bitcoin Forum
May 09, 2024, 07:38:52 AM *
News: Latest Bitcoin Core release: 27.0 [Torrent]
 
  Home Help Search Login Register More  
  Show Posts
Pages: [1]
1  Bitcoin / Development & Technical Discussion / How 51% attack is deterministically implemented on testnet? on: January 28, 2019, 05:05:25 AM
Just for scientific reasons!

How 51% attack is implemented on testnet. I want to see the results visually ?
Is disconnecting one node from chain for some time will do the it properly or other nodes recognize it once it is added to the chain ?
2  Bitcoin / Development & Technical Discussion / My transactions get stuck in memory pool !!! on: January 08, 2019, 08:15:13 AM
Several weeks ago I asked same question. I created my private chain with a very low difficulty (for implementing some tests) and when testing the network and creating transactions they get lost some how!!! Here's a scenario with images attached:

1. I created two node s on same machine, mined one of them till my custom coinbase maturity (I changed it to 10 blocks).
2. I made a transaction from first node to second node (2 btcs), then mined it with second node using command "generate  1". Till this stage it worked fine. See the image for results (first node is in the left and second node is in the right):



3.In this stage no matter from which side I create transactions. It gets stuck in memory  pool. No matter how hard i try to mine it, no peer would  add it to the chain. I created another transaction from first node to second node. See the picture.



I don't this the problem is with fee because with enough fee I still have the problem.
The link to my repository  is : https://github.com/chameleon1239/bitcoin.git

Any one has any idea? I didn't change the source code for confirming transactions  or memory pool.
3  Bitcoin / Development & Technical Discussion / Questions around operation of bitcoin with no blocks and dns disabled.. on: December 14, 2018, 03:04:17 PM
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 <address> <amount>
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.
4  Bitcoin / Development & Technical Discussion / Fee estimation failed. Fallbackfee is disabled.... on: December 11, 2018, 06:47:51 AM
Hello
Recently I forked bitcoin and changed difficulty of PoW for some tests.Each node mines coins properly but when I want to send some coins from one to the other using bitcoin-qt, in transaction fee section I choose "recommended" option, and by the time I want to send them I get this error :

"Fee estimation failed. Fallbackfee is disabled. Wait a few blocks or enable -fallbackfee"

Does anyone know what should I do ?

5  Alternate cryptocurrencies / Altcoin Discussion / How can I disable bitcoind auto test cases in main network? on: October 26, 2018, 06:13:12 PM
Hello. I recently saw some BOOST_AUTO_TEST_CASE in /src/test folder. I want to disable them specially pow_tests.cpp. Does any one know how it can be done ?
6  Bitcoin / Development & Technical Discussion / When bitcoind starts up, In where and which function difficulty is calculated? on: October 26, 2018, 08:08:16 AM
I am trying to understand bitcoin core deeply though debugging it is really a challenge for me because I'm newbie with gdb and not good with reading memory addresses and machine codes and getting variable values from there.

I wonder when starting up bitcoind where difficulty is calculated and how. I read the formula is pdiff/bdiff (current_difficulty). I f changed bdiff where pdiff is calculated?

There is a function in /src/rpc/blockchain.cpp named GetDifficulty but I think it is only used when rpc callings such as "bitcoin-cli getdifficulty" and "bitcoin-cli getblockheader  <hash of block> ". So what happens in the code if bitcoind is typed? Where will it be calculated?

Here is my own private version of bitcoin https://github.com/chameleon1239/bitcoin. I changed some parameters in chainparams.cpp and GetDifficulty function in  blockchain.cpp. but the whole code is untouched.

The problem I have with my code is -addnode command doesn't work properly.

Guys , the deadline is very close so any suggestions will be appreciated.
7  Alternate cryptocurrencies / Altcoin Discussion / Facing a problem while changing initial target threashold of my altcoin! on: October 08, 2018, 08:07:22 AM
I created my coin based on bitcoin and when I tried to change difficulty I encountered a problem. The problem is explained in my recent post in  Development & Technical Discussion part here :https://bitcointalk.org/index.php?topic=5039512.0. Does anyone know the answer to my last post? I would be really grateful.
8  Alternate cryptocurrencies / Altcoin Discussion / Facing a problem while trying to change initial difficulty target threashold!!!! on: September 28, 2018, 05:20:19 AM
Recently, I read https://bitcointalk.org/index.php?topic=3345808.0  for forking bitcoin. Then I wanted to change the difficulty(Target Treshold) inorder to mine blocks faster, so I set regtest network difficulty(0x207fffff) to main network(which was 0x1d00ffff) and created my genesis block from scratch. when I run bitcoind command i get this error :

Code:
bitcoind 
2018-09-28T04:46:14Z Bitcoin Core version v0.17.99.0-bddc7753d-dirty (release build)
2018-09-28T04:46:14Z InitParameterInteraction: parameter interaction: -whitelistforcerelay=1 -> setting -whitelistrelay=1
2018-09-28T04:46:14Z Assuming ancestors of block 0448936a4bf373c9c203012ce041a8f41d538861676aaeb9ef4a98aa08eb9360 have valid signatures.
2018-09-28T04:46:14Z Setting nMinimumChainWork=0000000000000000000000000000000000000000000000000000000100010001
2018-09-28T04:46:14Z Using the 'sse4(1way),sse41(4way),avx2(8way)' SHA256 implementation
2018-09-28T04:46:14Z Using RdRand as an additional entropy source
2018-09-28T04:46:14Z Default data directory /home/myuser/.bitcoin
2018-09-28T04:46:14Z Using data directory /home/myuser/.bitcoin
2018-09-28T04:46:14Z Using config file /home/myuser/.bitcoin/bitcoin.conf
2018-09-28T04:46:14Z Using at most 125 automatic connections (1024 file descriptors available)
2018-09-28T04:46:14Z Using 16 MiB out of 32/2 requested for signature cache, able to store 524288 elements
2018-09-28T04:46:14Z Using 16 MiB out of 32/2 requested for script execution cache, able to store 524288 elements
2018-09-28T04:46:14Z Using 0 threads for script verification
2018-09-28T04:46:14Z HTTP: creating work queue of depth 16
2018-09-28T04:46:14Z No rpcpassword set - using random cookie authentication.
2018-09-28T04:46:14Z Generated RPC authentication cookie /home/myuser/.bitcoin/.cookie
2018-09-28T04:46:14Z HTTP: starting 4 worker threads
2018-09-28T04:46:14Z Using wallet directory /home/myuser/.bitcoin/wallets
2018-09-28T04:46:14Z init message: Verifying wallet(s)...
2018-09-28T04:46:14Z Using BerkeleyDB version Berkeley DB 4.8.30: (April  9, 2010)
2018-09-28T04:46:14Z Using wallet wallet.dat
2018-09-28T04:46:14Z BerkeleyEnvironment::Open: LogDir=/home/myuser/.bitcoin/wallets/database ErrorFile=/home/myuser/.bitcoin/wallets/db.log
2018-09-28T04:46:14Z scheduler thread start
2018-09-28T04:46:14Z Cache configuration:
2018-09-28T04:46:14Z * Using 2.0MiB for block index database
2018-09-28T04:46:14Z * Using 8.0MiB for chain state database
2018-09-28T04:46:14Z * Using 440.0MiB for in-memory UTXO set (plus up to 286.1MiB of unused mempool space)
2018-09-28T04:46:14Z init message: Loading block index...
2018-09-28T04:46:14Z Opening LevelDB in /home/myuser/.bitcoin/blocks/index
2018-09-28T04:46:14Z Opened LevelDB successfully
2018-09-28T04:46:14Z Using obfuscation key for /home/myuser/.bitcoin/blocks/index: 0000000000000000
2018-09-28T04:46:14Z LoadBlockIndexDB: last block file = 0
2018-09-28T04:46:14Z LoadBlockIndexDB: last block file info: CBlockFileInfo(blocks=0, size=0, heights=0...0, time=1970-01-01...1970-01-01)
2018-09-28T04:46:14Z Checking all blk files are present...
2018-09-28T04:46:14Z Initializing databases...
2018-09-28T04:46:14Z Pre-allocating up to position 0x1000000 in blk00000.dat
2018-09-28T04:46:14Z Opening LevelDB in /home/myuser/.bitcoin/chainstate
2018-09-28T04:46:14Z Opened LevelDB successfully
2018-09-28T04:46:14Z Wrote new obfuscate key for /home/myuser/.bitcoin/chainstate: 486c004dfb89eb73
2018-09-28T04:46:14Z Using obfuscation key for /home/myuser/.bitcoin/chainstate: 486c004dfb89eb73
2018-09-28T04:46:14Z init message: Rewinding blocks...
2018-09-28T04:46:14Z  block index              47ms
2018-09-28T04:46:14Z init message: Loading wallet...
2018-09-28T04:46:14Z [default wallet] nFileVersion = 179900
2018-09-28T04:46:14Z [default wallet] Keys: 0 plaintext, 0 encrypted, 0 w/ metadata, 0 total. Unknown wallet records: 0
2018-09-28T04:46:14Z [default wallet] Performing wallet upgrade to 169900
2018-09-28T04:46:18Z [default wallet] keypool added 2000 keys (1000 internal), size=2000 (1000 internal)
2018-09-28T04:46:18Z [default wallet] Wallet completed loading in            3384ms
2018-09-28T04:46:18Z [default wallet] setKeyPool.size() = 2000
2018-09-28T04:46:18Z [default wallet] mapWallet.size() = 0
2018-09-28T04:46:18Z [default wallet] mapAddressBook.size() = 0
2018-09-28T04:46:18Z ERROR: ReadBlockFromDisk: Errors in block header at CDiskBlockPos(nFile=0, nPos=8)
2018-09-28T04:46:18Z *** Failed to read block
2018-09-28T04:46:18Z Error: Error: A fatal internal error occurred, see debug.log for details
Error: Error: A fatal internal error occurred, see debug.log for details
Segmentation fault (core dumped)

There is actually nothing more than what I get in debug.log. I tried to run it with -reindex (though I don't precisely know what reindex does!?) and I get :

Code:
bitcoind -reindex
2018-09-28T04:47:06Z Bitcoin Core version v0.17.99.0-bddc7753d-dirty (release build)
2018-09-28T04:47:06Z InitParameterInteraction: parameter interaction: -whitelistforcerelay=1 -> setting -whitelistrelay=1
2018-09-28T04:47:06Z Assuming ancestors of block 0448936a4bf373c9c203012ce041a8f41d538861676aaeb9ef4a98aa08eb9360 have valid signatures.
2018-09-28T04:47:06Z Setting nMinimumChainWork=0000000000000000000000000000000000000000000000000000000100010001
2018-09-28T04:47:06Z Using the 'sse4(1way),sse41(4way),avx2(8way)' SHA256 implementation
2018-09-28T04:47:06Z Using RdRand as an additional entropy source
2018-09-28T04:47:06Z Default data directory /home/myuser/.bitcoin
2018-09-28T04:47:06Z Using data directory /home/myuser/.bitcoin
2018-09-28T04:47:06Z Using config file /home/myuser/.bitcoin/bitcoin.conf
2018-09-28T04:47:06Z Using at most 125 automatic connections (1024 file descriptors available)
2018-09-28T04:47:06Z Using 16 MiB out of 32/2 requested for signature cache, able to store 524288 elements
2018-09-28T04:47:06Z Using 16 MiB out of 32/2 requested for script execution cache, able to store 524288 elements
2018-09-28T04:47:06Z Using 0 threads for script verification
2018-09-28T04:47:06Z HTTP: creating work queue of depth 16
2018-09-28T04:47:06Z No rpcpassword set - using random cookie authentication.
2018-09-28T04:47:06Z Generated RPC authentication cookie /home/myuser/.bitcoin/.cookie
2018-09-28T04:47:06Z HTTP: starting 4 worker threads
2018-09-28T04:47:06Z Using wallet directory /home/myuser/.bitcoin/wallets
2018-09-28T04:47:06Z init message: Verifying wallet(s)...
2018-09-28T04:47:06Z Using BerkeleyDB version Berkeley DB 4.8.30: (April  9, 2010)
2018-09-28T04:47:06Z Using wallet wallet.dat
2018-09-28T04:47:06Z BerkeleyEnvironment::Open: LogDir=/home/myuser/.bitcoin/wallets/database ErrorFile=/home/myuser/.bitcoin/wallets/db.log
2018-09-28T04:47:06Z scheduler thread start
2018-09-28T04:47:06Z Cache configuration:
2018-09-28T04:47:06Z * Using 2.0MiB for block index database
2018-09-28T04:47:06Z * Using 8.0MiB for chain state database
2018-09-28T04:47:06Z * Using 440.0MiB for in-memory UTXO set (plus up to 286.1MiB of unused mempool space)
2018-09-28T04:47:06Z init message: Loading block index...
2018-09-28T04:47:06Z Wiping LevelDB in /home/myuser/.bitcoin/blocks/index
2018-09-28T04:47:06Z Opening LevelDB in /home/myuser/.bitcoin/blocks/index
2018-09-28T04:47:06Z Opened LevelDB successfully
2018-09-28T04:47:06Z Using obfuscation key for /home/myuser/.bitcoin/blocks/index: 0000000000000000
2018-09-28T04:47:06Z Initializing databases...
2018-09-28T04:47:06Z Wiping LevelDB in /home/myuser/.bitcoin/chainstate
2018-09-28T04:47:06Z Opening LevelDB in /home/myuser/.bitcoin/chainstate
2018-09-28T04:47:06Z Opened LevelDB successfully
2018-09-28T04:47:06Z Wrote new obfuscate key for /home/myuser/.bitcoin/chainstate: 329d28cbdd513256
2018-09-28T04:47:06Z Using obfuscation key for /home/myuser/.bitcoin/chainstate: 329d28cbdd513256
2018-09-28T04:47:06Z  block index              20ms
2018-09-28T04:47:06Z init message: Loading wallet...
2018-09-28T04:47:06Z [default wallet] nFileVersion = 179900
2018-09-28T04:47:06Z [default wallet] Keys: 2001 plaintext, 0 encrypted, 2001 w/ metadata, 2001 total. Unknown wallet records: 0
2018-09-28T04:47:06Z [default wallet] Wallet completed loading in             112ms
2018-09-28T04:47:06Z [default wallet] setKeyPool.size() = 2000
2018-09-28T04:47:06Z [default wallet] mapWallet.size() = 0
2018-09-28T04:47:06Z [default wallet] mapAddressBook.size() = 0
2018-09-28T04:47:06Z Reindexing block file blk00000.dat...
2018-09-28T04:47:06Z ERROR: AcceptBlock: high-hash, proof of work failed (code 16)
2018-09-28T04:47:07Z Reindexing finished
2018-09-28T04:47:07Z Failed to open mempool file from disk. Continuing anyway.

It seems to have problem with PoW. I guessed there is something with this line in "chainparams.cpp":
Code:
 txNew.vin[0].scriptSig = CScript() << 486604799 << CScriptNum(4) << std::vector<unsigned char>((const unsigned char*)pszTimestamp, (const unsigned char*)pszTimestamp + strlen(pszTimestamp));

At first I set 486604799 (decimal of bitcoin core's initial difficulty 0x1d00ffff) to the new difficulty 545259519 (decimal of 0x207fffff) but I get core dumped instantly.Maybe this
 
Code:
if (UintToArith256(hash) > bnTarget)
     return false;
from pow.cpp always returns false. Anyone has any idea what should I do ? I will be very grateful.
Pages: [1]
Powered by MySQL Powered by PHP Powered by SMF 1.1.19 | SMF © 2006-2009, Simple Machines Valid XHTML 1.0! Valid CSS!