saifi009 / bitcoinj

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

Patch to allow alternative BlockStores to exist in a different Java package #7

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
Index: src/com/google/bitcoin/core/BlockStore.java
===================================================================
--- src/com/google/bitcoin/core/BlockStore.java (revision 38)
+++ src/com/google/bitcoin/core/BlockStore.java (working copy)
@@ -26,7 +26,7 @@
  *
  * BlockStores are thread safe.
  */
-interface BlockStore {
+public interface BlockStore {
     /**
      * Saves the given block header+extra data. The key isn't specified explicitly as it can be calculated from the
      * StoredBlock directly. Can throw if there is a problem with the underlying storage layer such as running out of
Index: src/com/google/bitcoin/core/StoredBlock.java
===================================================================
--- src/com/google/bitcoin/core/StoredBlock.java    (revision 39)
+++ src/com/google/bitcoin/core/StoredBlock.java    (working copy)
@@ -27,7 +27,7 @@
  *
  * StoredBlocks are put inside a {@link BlockStore} which saves them to memory or disk.
  */
-class StoredBlock {
+public class StoredBlock {
     /**
      * The block header this object wraps. The referenced block object must not have any transactions in it.
      */
@@ -45,12 +45,24 @@
      */
     int height;

-    StoredBlock(Block header, BigInteger chainWork, int height) {
+    public StoredBlock(Block header, BigInteger chainWork, int height) {
         assert header.transactions == null : "Should not have transactions in a block header object";
         this.header = header;
         this.chainWork = chainWork;
         this.height = height;
     }
+    
+    public Block getHeader() {
+   return header;
+    }
+    
+    public BigInteger getChainWork() {
+   return chainWork;
+    }
+    
+    public int getHeight() {
+   return height;
+    }

     /** Returns true if this objects chainWork is higher than the others. */
     boolean moreWorkThan(StoredBlock other) {

Original issue reported on code.google.com by andreas....@gmail.com on 26 Mar 2011 at 12:30

GoogleCodeExporter commented 9 years ago
I've made these interfaces and classes public. Does it work for you?

Original comment by hearn@google.com on 28 Mar 2011 at 6:03