Bitcoin Forum
June 14, 2024, 04:50:59 PM *
News: Voting for pizza day contest
 
   Home   Help Search Login Register More  
Pages: [1]
  Print  
Author Topic: Android create checkpoints file: Network provided difficulty bits do not match  (Read 1498 times)
phoenixzMexico (OP)
Newbie
*
Offline Offline

Activity: 5
Merit: 0


View Profile WWW
July 16, 2014, 11:51:11 PM
 #1

So I'm building an Android wallet for Vegas coin (See https://github.com/VegasCoin) which is based off Franko coin, which is based off the schildbach android wallet. All went fine until I started building the checkpoints file, where I get the error "Network provided difficulty bits do not match what was calculated"

To build the checkpoints file, I use
Code:
mvn exec:java -Dexec.mainClass=com.google.bitcoin.tools.BuildCheckpoints
with this result:

Code:
$ mvn exec:java -Dexec.mainClass=com.google.bitcoin.tools.BuildCheckpoints
[INFO] Scanning for projects...
[INFO]
[INFO] Using the builder org.apache.maven.lifecycle.internal.builder.singlethreaded.SingleThreadedBuilder with a thread count of 1
[INFO]                                                                        
[INFO] ------------------------------------------------------------------------
[INFO] Building vegasj Tools 0.11
[INFO] ------------------------------------------------------------------------
[INFO]
[INFO] --- exec-maven-plugin:1.3.1:java (default-cli) @ vegasj-tools ---
[WARNING] Warning: killAfter is now deprecated. Do you need it ? Please comment on MEXEC-6.
03:31:33 9 AbstractBlockChain.<init>: chain head is at height 0:
v1 block:
   previous block: 0000000000000000000000000000000000000000000000000000000000000000
   merkle root: 3f5f95df1e8ba364df188ce3a5a5c4aa27d579272d4eb3f8cc1904a88cba872f
   time: [1392172369] Tue Feb 11 20:32:49 CST 2014
   difficulty target (nBits): 504365040
   nonce: 2893208

03:31:34 12 NioClientManager.handleKey: Successfully connected to laptop/127.0.1.1:52400
03:31:34 12 Peer.connectionOpened: Announcing to laptop/127.0.1.1:52400 as: /VegasJ:0.11-SNAPSHOT/
03:31:34 12 Peer.processVersionMessage: Connected to 127.0.1.1: version=70002, subVer='/Satoshi:2.0.1.1/', services=0x3, time=2014-07-16 03:31:34, blocks=337532
03:31:34 12 PeerGroup.handleNewPeer: [127.0.1.1]:52400: New peer
03:31:34 12 PeerGroup.setDownloadPeer: Setting download peer: [127.0.1.1]:52400
03:31:34 12 DownloadListener.startDownload: Downloading block chain of size 337532. This may take a while.
03:31:34 12 AbstractBlockChain.checkDifficultyTransitions_V1: Difficulty hit proof of work limit: 1f1fed02d82d82d82d82d82d82d82d82d82d82d82d82d82d82d82d82d82d
Checkpointing block 04abad822c2b1d9ed67dddeecea13ee5f4fb11a2ed32cdf59c319f1718c8492a at height 720
03:31:34 12 AbstractBlockChain.add: 861 blocks per second
Checkpointing block bc70e33acea9823a70ac38718455727ae4b64d6d2bf37882191cbb0f1ad94b27 at height 1440
Checkpointing block b829708031fc089f3ae540f72a7beb826d84cca63135d27ce9f5133f44a75406 at height 2160
03:31:35 12 AbstractBlockChain.add: 1595 blocks per second
Checkpointing block 720d6a76c4a16d2fd29ed712d2b37cb834a242cf4b16958df1104af32a5ec59d at height 2880
03:31:36 12 DownloadListener.progress: Chain download 1% done with 334156 blocks to go, block date Feb 14, 2014 4:24:59 AM
Checkpointing block 9a09621e50850f6e31164aa63098619760b857294db6c475988959cdc3d3bcd0 at height 3600
03:31:36 12 AbstractBlockChain.add: 1544 blocks per second
Checkpointing block 16f11edd4ef303f7703bdacbbe03a5bb1db651e8e369724803058b185c1d5717 at height 4320
Checkpointing block 4b4e0186b84d4bdb49fb3cfc87078964d84e0e8bf52983b4ad93e9e8456b8dba at height 5040
03:31:37 12 AbstractBlockChain.add: 1492 blocks per second
Checkpointing block 8e470e1721bbf33989d807ea255e28560b38a4616982cf5452e07170f04ec8e3 at height 5760
Checkpointing block d426a6b7c97cb9f52195b134de13b80ab7d4059f24a4288936653f19967ff4d0 at height 6480
03:31:38 12 DownloadListener.progress: Chain download 2% done with 330781 blocks to go, block date Feb 16, 2014 2:07:01 PM
Checkpointing block a211f4708b4e5b559f07b7c7044f09fb625e66b802fe1ecc904b120a8753697c at height 7200
03:31:38 12 AbstractBlockChain.add: 1712 blocks per second
Checkpointing block a63ea505ce382d5249f38226a7aff6ef5d28f7395695648d79fd7231fadc84fc at height 7920
03:31:39 12 AbstractBlockChain.add: 1411 blocks per second
Checkpointing block fa26aa1649a219d48d8aec8c3375edd4ecbb0d23b7640d00e8c82676f17fa193 at height 8640
Checkpointing block 8c8f54df4a2d29d7ab77336e06477651aea5a3e8ffdd6b47a76634b6a282978b at height 9360
03:31:40 12 AbstractBlockChain.add: 1385 blocks per second
Checkpointing block ce4b7e96eb0afbcf70f982bddfa387515a5ac7529369956c05d273e9b6560397 at height 10080
03:31:41 12 DownloadListener.progress: Chain download 3% done with 327406 blocks to go, block date Feb 22, 2014 9:42:01 PM
Checkpointing block f27b6115f3ffcc8b235cf3db107cc9cf1065125a99c9184cd38993cf320d14f4 at height 10800
03:31:41 12 AbstractBlockChain.add: 1507 blocks per second
Checkpointing block aa5d31028f8698851acccc6dbdf57d78af8641cb87f3836f978839435025db5c at height 11520
03:31:42 12 AbstractBlockChain.add: Block does not connect: 7e3239126b95f08f9f50005047f494deeba4128a85145783c93fc56783c7f014 prev 3e70b836934a45885353d7672145959ca92e6b2ac7440d8c5300222a281f396d
03:31:42 12 Peer.processBlock: Did not start chain download on solved block due to in-flight header download.
03:31:42 12 AbstractBlockChain.add: Block does not connect: 6e2487d0ecf5d283f05a979f7459f64049c16ba80adbad15664cb82b89701100 prev 7e3239126b95f08f9f50005047f494deeba4128a85145783c93fc56783c7f014
03:31:42 12 Peer.processBlock: Did not start chain download on solved block due to in-flight header download.
Checkpointing block 779d7fbefa3fe0a17e894336e1d44ed49a4a2a729b1e34128a5d340965e2cd67 at height 12240
Checkpointing block ca1d61a3faf57350a97937d56af1c79aa870a5259d7f917a92d7c78cc5094127 at height 12960
03:31:42 12 AbstractBlockChain.add: 1855 blocks per second
03:31:43 12 DownloadListener.progress: Chain download 4% done with 324030 blocks to go, block date Feb 28, 2014 5:33:36 AM
Checkpointing block c803cef55436173af56bbe75dc01556e3a33a52973a059e97b48d90b3bdfb598 at height 13680
Checkpointing block c60af20b56b8636cd539fefae8da0e31e2abf2d81d26829e8c617c3082d43b09 at height 14400
03:31:43 12 Peer.processHeaders: Block header verification failed
com.google.bitcoin.core.VerificationException: Could not verify block 1681a49faa25c2ce30e53333e126c8cc102fac66a24b95c60ff73e2a6a22849b
v1 block:
   previous block: 545e9f880e5695d30100bfb43fd8a16c3abdd7c5e78c0fc6e85b873f89d297df
   merkle root: 67142d11c63bc5d88f94299a020f5df9c7ca583eaf998ba42d994af39b114aaa
   time: [1393739887] Sat Mar 01 23:58:07 CST 2014
   difficulty target (nBits): 486655270
   nonce: 446365696

        at com.google.bitcoin.core.AbstractBlockChain.add(AbstractBlockChain.java:260)
        at com.google.bitcoin.core.Peer.processHeaders(Peer.java:480)
        at com.google.bitcoin.core.Peer.processMessage(Peer.java:324)
        at com.google.bitcoin.core.PeerSocketHandler.receiveBytes(PeerSocketHandler.java:139)
        at com.google.bitcoin.net.ConnectionHandler.handleKey(ConnectionHandler.java:216)
        at com.google.bitcoin.net.NioClientManager.handleKey(NioClientManager.java:74)
        at com.google.bitcoin.net.NioClientManager.run(NioClientManager.java:109)
        at com.google.common.util.concurrent.AbstractExecutionThreadService$1$1.run(AbstractExecutionThreadService.java:52)
        at java.lang.Thread.run(Thread.java:744)
Caused by: com.google.bitcoin.core.VerificationException: Network provided difficulty bits do not match what was calculated: 1c5260000000000000000000000000000000000000000000000000000 vs 163d50000000000000000000000000000000000000000000000000000
        at com.google.bitcoin.core.AbstractBlockChain.checkDifficultyTransitions_V1(AbstractBlockChain.java:894)
        at com.google.bitcoin.core.AbstractBlockChain.checkDifficultyTransitions(AbstractBlockChain.java:809)
        at com.google.bitcoin.core.AbstractBlockChain.add(AbstractBlockChain.java:394)
        at com.google.bitcoin.core.AbstractBlockChain.add(AbstractBlockChain.java:250)
        ... 8 more
03:32:11 12 AbstractBlockChain.add: 1757 blocks per second
03:32:11 12 AbstractBlockChain.add: Block does not connect: d310ec93d6a66355f19cd2111106c854526ec94dfada5bf61cf32169eb013eb6 prev 6e2487d0ecf5d283f05a979f7459f64049c16ba80adbad15664cb82b89701100
03:32:11 12 Peer.processBlock: Did not start chain download on solved block due to in-flight header download.
03:32:16 12 AbstractBlockChain.add: Block does not connect: e713bb16b68268e38e3b816827ed8b0310c231671d567b7539d0cf40ad372405 prev d310ec93d6a66355f19cd2111106c854526ec94dfada5bf61cf32169eb013eb6
03:32:16 12 Peer.processBlock: Did not start chain download on solved block due to in-flight header download.
03:32:34 12 AbstractBlockChain.add: Block does not connect: e7fa4d35c5a2d7264c1c406f5880afba4567ee3fa8795219bfc6227d9b742b50 prev e713bb16b68268e38e3b816827ed8b0310c231671d567b7539d0cf40ad372405
03:32:34 12 Peer.processBlock: Did not start chain download on solved block due to in-flight header download.
03:32:42 12 AbstractBlockChain.add: Block does not connect: b2fc53ee5ad8cd9f450978332dcdabdc7886144b7acb24d46e86d036ce9cd2d6 prev e7fa4d35c5a2d7264c1c406f5880afba4567ee3fa8795219bfc6227d9b742b50
03:32:42 12 Peer.processBlock: Did not start chain download on solved block due to in-flight header download.
03:33:09 12 AbstractBlockChain.add: Block does not connect: a50d529961359b974ec2d4073b52e0003e70aac6a541736b2796ef3b6834d5a2 prev b2fc53ee5ad8cd9f450978332dcdabdc7886144b7acb24d46e86d036ce9cd2d6
03:33:09 12 Peer.processBlock: Did not start chain download on solved block due to in-flight header download.
03:33:35 12 AbstractBlockChain.add: Block does not connect: a46c55920a6161a4142fd02d66f203ef8f623b5ba90c55d4170648305298f779 prev a50d529961359b974ec2d4073b52e0003e70aac6a541736b2796ef3b6834d5a2
03:33:35 12 Peer.processBlock: Did not start chain download on solved block due to in-flight header download.
03:34:08 12 AbstractBlockChain.add: Block does not connect: 8db7f5af7f407a9c40614d57b8512130fe80c36a16b3b03b8575a384b96ee509 prev a46c55920a6161a4142fd02d66f203ef8f623b5ba90c55d4170648305298f779
03:34:08 12 Peer.processBlock: Did not start chain download on solved block due to in-flight header download.
03:34:08 12 MemoryPool.seen: [127.0.1.1]:52400: Peer announced new transaction [1] 5ef1a7c635aabf2f84c65f24bcf63500c634c84e9973f6f0ed72744ca6918174
03:34:09 12 MemoryPool.seen: [127.0.1.1]:52400: Peer announced new transaction [1] 28d6d33f4d47f520459b2ee74bb3db4093e5d9a70c991d7350fd7b19f5fc3658
03:34:10 12 MemoryPool.seen: [127.0.1.1]:52400: Peer announced new transaction [1] 3e2100175c33aebe654e7a1f4b2333fe18cc6eee3dd079225adc34cd0ecbf2a9
03:34:16 12 MemoryPool.seen: [127.0.1.1]:52400: Peer announced new transaction [1] e843a614e46ad6b2b410ecd01e5e13f95559624de822e3f1edb1411626b66078
03:34:16 12 MemoryPool.seen: [127.0.1.1]:52400: Peer announced new transaction [1] c43517ebbe8a3cd8f3898ff03cd60b9bd9ca67152a6504e8173f0d987a5993c7
03:34:16 12 MemoryPool.seen: [127.0.1.1]:52400: Peer announced new transaction [1] 3e23e837f68250568bb51a4b2b65a681b5a853526495d92fd5c05367c171b7c6
03:34:16 12 MemoryPool.seen: [127.0.1.1]:52400: Peer announced new transaction [1] e9fbed74091b84e772cbce5eb3ce52d46b93eba95efdba9e8f3400eecb7bc2a5
03:34:16 12 MemoryPool.seen: [127.0.1.1]:52400: Peer announced new transaction [1] ad75a22b4568a0b1068dbd646bdd12e88d324e923452e677a0968ce38a8fb917
03:34:31 12 MemoryPool.seen: [127.0.1.1]:52400: Peer announced new transaction [1] ce171dff4d0103cb6aae4ae7f33927ee3347d0e8fc0842d75579afd0949c0089
03:34:55 12 AbstractBlockChain.add: Block does not connect: c7caaf40be8fc997f24a53096bea2838bfafb1aaff5a1ccc8ccb249dfe66a629 prev 8db7f5af7f407a9c40614d57b8512130fe80c36a16b3b03b8575a384b96ee509
03:34:55 12 Peer.processBlock: Did not start chain download on solved block due to in-flight header download.
03:35:05 12 AbstractBlockChain.add: Block does not connect: 2e05a2c5f53807069825197e5ca5d6dfbe47244a7ed81734d663d67798ec5a6b prev c7caaf40be8fc997f24a53096bea2838bfafb1aaff5a1ccc8ccb249dfe66a629
03:35:05 12 Peer.processBlock: Did not start chain download on solved block due to in-flight header download.
03:35:17 12 MemoryPool.seen: [127.0.1.1]:52400: Peer announced new transaction [1] 0ddba3ce8f184e8b63b967dff8e1c89ce5e0247385d55b35b6b481a8bc590af9
Ad infinitum..

So basically it hangs on block 15120. I've tried running the android wallet without the checkpoints file, and it starts syncing from 0 and stops at (you guessed it) 15119, with 15120 being the problem..

The block in question is here: http://explorer.vegascoin.co/block/1681a49faa25c2ce30e53333e126c8cc102fac66a24b95c60ff73e2a6a22849b

If memory serves me right, we had an issue around that block, possibly a fork in the chain which had been resolved. Desktop wallets all work fine without any problem, but the android libary keeps hanging

So now I am stuck  Huh. I need a checkpoints file somehow, but I do not know how to resolve this difficulties not matching issue. Is there anything anybody could do to help me? I can send some in BTC for time spent on helping resolving this issue..
HashEngineering
Sr. Member
****
Offline Offline

Activity: 350
Merit: 250

Independent Cryptoveloper


View Profile WWW
December 14, 2014, 11:59:24 PM
 #2

This was any easy problem to fix.  Let me know if you have this problem too.

GRS:  FrFpTbfEAni5Ruf8mNdwVQazJVJaQyEM2Y
BTC:  128Ptecsv4j6NoxdBxdvGzBtipfaAarZMJ
https://bitcointalk.org/index.php?topic=336215 - Android Wallet Creation Service
toy
Newbie
*
Offline Offline

Activity: 2
Merit: 0


View Profile
December 17, 2014, 12:57:02 PM
 #3

Hey Hash, i was stuck with same problem( i guess ):

12-17 09:54:11.045  13507-13540/de.schildbach.wallet_ltc W/AbstractBlockChain﹕ [NioClientManager] Block does not connect: 877520a5debaf2cd4575d0a26063a3383e83e52764d65effc4b896ec20ec667e prev e174361305d2596b6252cc254ae235c30517b6701895d631dde2e20868880b77
    [ 12-17 09:54:11.065 13507:13540 W/PeerSocketHandlerjava.lang.IllegalArgumentException: null
            at com.google.common.base.Precond[NioClientManager] [54.92.6.210]:11208 -
    java.lang.IllegalArgumentException: null
            at com.google.common.base.Preconditions.checkArgument(Preconditions.java:76) ~[na:0.0]
            at com.google.bitcoin.core.AbstractBlockChain$OrphanBlock.<init>(AbstractBlockChain.java:119) ~[na:0.0]
            at com.google.bitcoin.core.AbstractBlockChain.add(AbstractBlockChain.java:392) ~[na:0.0]
            at com.google.bitcoin.core.AbstractBlockChain.add(AbstractBlockChain.java:252) ~[na:0.0]
            at com.google.bitcoin.core.Peer.processHeaders(Peer.java:482) ~[na:0.0]
            at com.google.bitcoin.core.Peer.processMessage(Peer.java:325) ~[na:0.0]
            at com.google.bitcoin.core.PeerSocketHandler.receiveBytes(PeerSocketHandler.java:141) ~[na:0.0]
            at com.google.bitcoin.net.ConnectionHandler.handleKey(ConnectionHandler.java:216) ~[na:0.0]
            at com.google.bitcoin.net.NioClientManager.handleKey(NioClientManager.java:74) ~[na:0.0]
            at com.google.bitcoin.net.NioClientManager.run(NioClientManager.java:109) ~[na:0.0]
            at com.google.common.util.concurrent.AbstractExecutionThreadService$1$1.run(AbstractExecutionThreadService.java:52) ~[na:0.0]
            at java.lang.Thread.run(Thread.java:811) ~[na:0.0]
    [ 12-17 09:54:11.080 13507:13540 I/WalletApplicationjava.lang.IllegalArgumentException: null
            at com.google.common.base.Precond[NioClientManager] bitcoinj uncaught exception
    java.lang.IllegalArgumentException: null
            at com.google.common.base.Preconditions.checkArgument(Preconditions.java:76) ~[na:0.0]
            at com.google.bitcoin.core.AbstractBlockChain$OrphanBlock.<init>(AbstractBlockChain.java:119) ~[na:0.0]
            at com.google.bitcoin.core.AbstractBlockChain.add(AbstractBlockChain.java:392) ~[na:0.0]
            at com.google.bitcoin.core.AbstractBlockChain.add(AbstractBlockChain.java:252) ~[na:0.0]
            at com.google.bitcoin.core.Peer.processHeaders(Peer.java:482) ~[na:0.0]
            at com.google.bitcoin.core.Peer.processMessage(Peer.java:325) ~[na:0.0]
            at com.google.bitcoin.core.PeerSocketHandler.receiveBytes(PeerSocketHandler.java:141) ~[na:0.0]
            at com.google.bitcoin.net.ConnectionHandler.handleKey(ConnectionHandler.java:216) ~[na:0.0]
            at com.google.bitcoin.net.NioClientManager.handleKey(NioClientManager.java:74) ~[na:0.0]
            at com.google.bitcoin.net.NioClientManager.run(NioClientManager.java:109) ~[na:0.0]
            at com.google.common.util.concurrent.AbstractExecutionThreadService$1$1.run(AbstractExecutionThreadService.java:52) ~[na:0.0]
            at java.lang.Thread.run(Thread.java:811) ~[na:0.0]

What was the resolution that you found ?
HashEngineering
Sr. Member
****
Offline Offline

Activity: 350
Merit: 250

Independent Cryptoveloper


View Profile WWW
December 21, 2014, 05:17:12 PM
 #4

In the original post error, we found that the difficulty adjustment code was found to have an error. 

Your problem is different.  Did you delete the checkpoints file in the wallet/assets folder?

If you are forking from another coin, then the other coin has a checkpoints file that will be left behind and not compatible with your new coin. 

This is one thing that could cause this error, perhaps.

GRS:  FrFpTbfEAni5Ruf8mNdwVQazJVJaQyEM2Y
BTC:  128Ptecsv4j6NoxdBxdvGzBtipfaAarZMJ
https://bitcointalk.org/index.php?topic=336215 - Android Wallet Creation Service
vicmpen
Newbie
*
Offline Offline

Activity: 1
Merit: 0


View Profile
May 26, 2016, 10:24:20 AM
 #5

Hey Guys, noob here.

We have created a simple litecoin wallet and i am responsible for the android App.

Everything goes well until i disabled checkpoints and my chain syncs up until height 31. I get an exception that there is a difficulty mismatch. Note here that the recalc interval is indeed 16 blocks.

Code:
05-26 13:07:41.876  7339  7381 W Peercom.google.bitcoin.core.VerificationException: Could not verify block a2ba184558d58648ecedCaused by: com.google.bitcoin.core.VerificationException: Unexpected change in difficulty at height 31: 1e0fd5e6 vs 1e10024c

that you seem to have resolved accoring to Hash.

Any input?
HashEngineering
Sr. Member
****
Offline Offline

Activity: 350
Merit: 250

Independent Cryptoveloper


View Profile WWW
August 22, 2016, 03:18:03 AM
 #6

Hey Guys, noob here.

We have created a simple litecoin wallet and i am responsible for the android App.

Everything goes well until i disabled checkpoints and my chain syncs up until height 31. I get an exception that there is a difficulty mismatch. Note here that the recalc interval is indeed 16 blocks.

Code:
05-26 13:07:41.876  7339  7381 W Peercom.google.bitcoin.core.VerificationException: Could not verify block a2ba184558d58648ecedCaused by: com.google.bitcoin.core.VerificationException: Unexpected change in difficulty at height 31: 1e0fd5e6 vs 1e10024c

that you seem to have resolved accoring to Hash.

Any input?

There is not enough information to solve the problem.  My guess is that your coin's difficulty on block 16 is at the proof of work limit and so it matched by luck to your actual difficulty.  Did you change the difficulty adjustment code from the original litecoin difficulty algorithm?

GRS:  FrFpTbfEAni5Ruf8mNdwVQazJVJaQyEM2Y
BTC:  128Ptecsv4j6NoxdBxdvGzBtipfaAarZMJ
https://bitcointalk.org/index.php?topic=336215 - Android Wallet Creation Service
Pages: [1]
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.19 | SMF © 2006-2009, Simple Machines Valid XHTML 1.0! Valid CSS!