Package org.bitcoinj.core

Examples of org.bitcoinj.core.Sha256Hash


                status.addPledges(pledge);
            } else {
                // Remove transactions so the contract can't be closed by anyone who requests the status.
                // In future we may wish to optionally relax this constraint so anyone who can observe the project
                // can prove to themselves the pledges really exist, and the contract can be closed by any user.
                Sha256Hash origHash = LHUtils.hashFromPledge(pledge);
                LHProtos.Pledge.Builder scrubbedPledge = pledge.toBuilder()
                        .clearTransactions()
                        .setOrigHash(ByteString.copyFrom(origHash.getBytes()));
                status.addPledges(scrubbedPledge);
            }
            totalPledged += pledge.getTotalInputValue();
        }
View Full Code Here


        for (File file : event.getDragboard().getFiles()) {
            if (file.toString().endsWith(DiskManager.PROJECT_FILE_EXTENSION)) {
                importProject(file);
            } else if (file.toString().endsWith(DiskManager.PLEDGE_FILE_EXTENSION)) {
                try {
                    Sha256Hash hash = Sha256Hash.hashFileContents(file);
                    Files.copy(file.toPath(), AppDirectory.dir().resolve(hash + DiskManager.PLEDGE_FILE_EXTENSION));
                } catch (IOException e) {
                    GuiUtils.informationalAlert("Import failed",
                            "Could not copy the dropped pledge into the Lighthouse application directory: " + e);
                }
View Full Code Here

            String key = parts.get(0);
            String val = parts.get(1);
            if (val.equals("OPEN")) {
                projectStates.put(key, new LighthouseBackend.ProjectStateInfo(LighthouseBackend.ProjectState.OPEN, null));
            } else {
                Sha256Hash claimedBy = new Sha256Hash(val);   // Treat as hex string.
                log.info("Project {} is marked as claimed by {}", key, claimedBy);
                projectStates.put(key, new LighthouseBackend.ProjectStateInfo(LighthouseBackend.ProjectState.CLAIMED, claimedBy));
            }
        }
    }
View Full Code Here

TOP

Related Classes of org.bitcoinj.core.Sha256Hash

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.