novitski / bitcoinj

Automatically exported from code.google.com/p/bitcoinj
Apache License 2.0
0 stars 0 forks source link

"Failed to verify block" in BlockChainTest. "Hash is higher than target ..." #550

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
While running the BlockChainTest the following is reported:

SEVERE: Failed to verify block: 
com.google.bitcoin.core.VerificationException: Hash is higher than target: 
35d24a68152f1d9daded44796585406377cb9749db3d110d274bf5763c28785e vs 
7fff80000000000000000000000000000000000000000000000000000
    at com.google.bitcoin.core.Block.checkProofOfWork(Block.java:589)

This error occurs in the following context:

Running com.google.bitcoin.core.BlockChainTest
Apr 28, 2014 10:25:45 PM com.google.bitcoin.core.BlockChain <init>
INFO: chain head is:
v1 block: 
   previous block: 0000000000000000000000000000000000000000000000000000000000000000
   merkle root: 4a5e1e4baab89f3a32518a88c31bc87f618f76673e2cc77ab2127b7afdeda33b
   time: [1296688602] Wed Feb 02 15:16:42 PST 2011
   difficulty target (nBits): 487063544
   nonce: 384568319

Apr 28, 2014 10:25:46 PM com.google.bitcoin.core.BlockChain <init>
INFO: chain head is:
v1 block: 
   previous block: 0000000000000000000000000000000000000000000000000000000000000000
   merkle root: 4a5e1e4baab89f3a32518a88c31bc87f618f76673e2cc77ab2127b7afdeda33b
   time: [1296688602] Wed Feb 02 15:16:42 PST 2011
   difficulty target (nBits): 545259519
   nonce: 384568319

Apr 28, 2014 10:25:46 PM com.google.bitcoin.core.BlockChain add
SEVERE: Failed to verify block: 
com.google.bitcoin.core.VerificationException: Hash is higher than target: 
35d24a68152f1d9daded44796585406377cb9749db3d110d274bf5763c28785e vs 
7fff80000000000000000000000000000000000000000000000000000
    at com.google.bitcoin.core.Block.checkProofOfWork(Block.java:589)
    at com.google.bitcoin.core.Block.verifyHeader(Block.java:718)
    at com.google.bitcoin.core.BlockChain.add(BlockChain.java:164)
    at com.google.bitcoin.core.BlockChain.add(BlockChain.java:124)
    at com.google.bitcoin.core.BlockChainTest.testBasicChaining(BlockChainTest.java:72)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
    at java.lang.reflect.Method.invoke(Method.java:597)
    at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:44)
    at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:15)
    at org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:41)
    at org.junit.internal.runners.statements.InvokeMethod.evaluate(InvokeMethod.java:20)
    at org.junit.internal.runners.statements.RunBefores.evaluate(RunBefores.java:28)
    at org.junit.runners.BlockJUnit4ClassRunner.runNotIgnored(BlockJUnit4ClassRunner.java:79)
    at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:71)
    at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:49)
    at org.junit.runners.ParentRunner$3.run(ParentRunner.java:193)
    at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:52)
    at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:191)
    at org.junit.runners.ParentRunner.access$000(ParentRunner.java:42)
    at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:184)
    at org.junit.runners.ParentRunner.run(ParentRunner.java:236)
    at org.apache.maven.surefire.junit4.JUnit4TestSet.execute(JUnit4TestSet.java:53)
    at org.apache.maven.surefire.junit4.JUnit4Provider.executeTestSet(JUnit4Provider.java:123)
    at org.apache.maven.surefire.junit4.JUnit4Provider.invoke(JUnit4Provider.java:104)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
    at java.lang.reflect.Method.invoke(Method.java:597)
    at org.apache.maven.surefire.util.ReflectionUtils.invokeMethodWithArray(ReflectionUtils.java:164)
    at org.apache.maven.surefire.booter.ProviderFactory$ProviderProxy.invoke(ProviderFactory.java:110)
    at org.apache.maven.surefire.booter.SurefireStarter.invokeProvider(SurefireStarter.java:172)
    at org.apache.maven.surefire.booter.SurefireStarter.runSuitesInProcessWhenForked(SurefireStarter.java:104)
    at org.apache.maven.surefire.booter.ForkedBooter.main(ForkedBooter.java:70)

I've never run the Bitcoinj tests before, so perhaps my environment isn't 
sufficiently configured.  

Any pre-requisites to running these tests?  The wiki page on Testing 
(https://code.google.com/p/bitcoinj/wiki/Testing) doesn't mention anything 
specific.

Original issue reported on code.google.com by bpca...@gmail.com on 29 Apr 2014 at 10:30

GoogleCodeExporter commented 9 years ago
Ah.  Just noticed the code was from a very old snapshot (4) from around 2011.  
I'm rebasing the project to the trunk.  Problem solved.

Original comment by bpca...@gmail.com on 29 Apr 2014 at 11:53

GoogleCodeExporter commented 9 years ago

Original comment by andreas....@gmail.com on 30 Apr 2014 at 7:52