diff --git a/README.md b/README.md index ab260a201..3feaf44a5 100644 --- a/README.md +++ b/README.md @@ -1,10 +1,6 @@ -[![Build Status](https://travis-ci.org/bitcoinj/bitcoinj.png?branch=master)](https://travis-ci.org/bitcoinj/bitcoinj) [![Coverage Status](https://coveralls.io/repos/bitcoinj/bitcoinj/badge.png?branch=master)](https://coveralls.io/r/bitcoinj/bitcoinj?branch=master) +### Welcome to pivxj -[![Visit our IRC channel](https://kiwiirc.com/buttons/irc.freenode.net/bitcoinj.png)](https://kiwiirc.com/client/irc.freenode.net/bitcoinj) - -### Welcome to bitcoinj - -The bitcoinj library is a Java implementation of the Bitcoin protocol, which allows it to maintain a wallet and send/receive transactions without needing a local copy of Bitcoin Core. It comes with full documentation and some example apps showing how to use it. +The pivxj library is a Java implementation of the PIVX protocol, which allows it to maintain a wallet and send/receive transactions without needing a local copy of PIVX Core. It comes with full documentation and some example apps showing how to use it. ### Technologies @@ -41,18 +37,16 @@ These are found in the `examples` module. #### Forwarding service -This will download the block chain and eventually print a Bitcoin address that it has generated. +This will download the block chain and eventually print a PIVX address that it has generated. If you send coins to that address, it will forward them on to the address you specified. ``` cd examples - mvn exec:java -Dexec.mainClass=org.pivxj.examples.ForwardingService -Dexec.args="" + mvn exec:java -Dexec.mainClass=org.pivxj.examples.ForwardingService -Dexec.args="" + ``` Note that this example app *does not use checkpointing*, so the initial chain sync will be pretty slow. You can make an app that starts up and does the initial sync much faster by including a checkpoints file; see the documentation for more info on this technique. -### Where next? - -Now you are ready to [follow the tutorial](https://bitcoinj.github.io/getting-started). diff --git a/core/src/main/java/org/pivxj/core/Block.java b/core/src/main/java/org/pivxj/core/Block.java index b33698648..cf7ad2e12 100644 --- a/core/src/main/java/org/pivxj/core/Block.java +++ b/core/src/main/java/org/pivxj/core/Block.java @@ -296,7 +296,7 @@ protected void parse() throws ProtocolException { nonce = readUint32(); //System.out.println("parse nonce: "+nonce); int headerSize = getHeaderSize(); - if (isZerocoin()) { + if (isZerocoin() && length >= ZEROCOIN_HEADER_SIZE) { // accumulator zeroCoinAccumulator = readHash(true); //System.out.println("parse zeroCoinAccumulator: "+zeroCoinAccumulator); diff --git a/core/src/main/java/org/pivxj/core/Message.java b/core/src/main/java/org/pivxj/core/Message.java index b1acdd00d..93aa453d7 100644 --- a/core/src/main/java/org/pivxj/core/Message.java +++ b/core/src/main/java/org/pivxj/core/Message.java @@ -331,7 +331,7 @@ protected long readVarInt(int offset) throws ProtocolException { protected byte[] readBytes(int length) throws ProtocolException { if (length > MAX_SIZE) { - log.info("MAx size "+MAX_SIZE); + log.info("Max size "+MAX_SIZE); throw new ProtocolException("Claimed value length too large: " + length); } try { diff --git a/core/src/main/java/org/pivxj/store/LevelDBBlockStore.java b/core/src/main/java/org/pivxj/store/LevelDBBlockStore.java index 340af4d2e..7a3d134f9 100644 --- a/core/src/main/java/org/pivxj/store/LevelDBBlockStore.java +++ b/core/src/main/java/org/pivxj/store/LevelDBBlockStore.java @@ -88,6 +88,7 @@ public synchronized void put(StoredBlock block) throws BlockStoreException { //System.out.println("### block hash to save: "+blockHash.toString()); byte[] hash = blockHash.getBytes(); byte[] dbBuffer = buffer.array(); + db.put(hash, dbBuffer); // just for now to check something: StoredBlock dbBlock = get(Sha256Hash.wrap(hash)); @@ -96,7 +97,9 @@ public synchronized void put(StoredBlock block) throws BlockStoreException { assert Arrays.equals(dbBuffer,bufferTwo):"database is shit.."; - assert Arrays.equals(dbBlock.getHeader().getHash().getBytes(),hash): "put is different than get in db.. "+block.getHeader().getHashAsString()+", db: "+dbBlock.getHeader().getHashAsString(); + if (!Arrays.equals(dbBlock.getHeader().getHash().getBytes(),hash)) { + assert false : "put is different than get in db.. " + block.getHeader().getHashAsString() + ", db: " + dbBlock.getHeader().getHashAsString(); + } } @Override @Nullable