Examples of Coin


Examples of com.google.bitcoin.core.Coin

            } catch (IOException e) {
                throw new RuntimeException(e)// Cannot happen.
            }
            scriptPubKey.write(OP_EQUAL);
           
            Coin lastOutputValue = out11.value.subtract(SATOSHI);
            TransactionOutPoint lastOutPoint;
            {
                Transaction tx = new Transaction(params);
                tx.addOutput(new TransactionOutput(params, tx, SATOSHI, scriptPubKey.toByteArray()));
                tx.addOutput(new TransactionOutput(params, tx, lastOutputValue, new byte[]{OP_1}));
                addOnlyInputToTransaction(tx, out11);
                lastOutPoint = new TransactionOutPoint(params, 1, tx.getHash());
                b39.addTransaction(tx);
            }
            b39numP2SHOutputs++;
           
            while (b39.getMessageSize() < Block.MAX_BLOCK_SIZE)
            {
                Transaction tx = new Transaction(params);

                lastOutputValue = lastOutputValue.subtract(SATOSHI);
                tx.addOutput(new TransactionOutput(params, tx, SATOSHI, scriptPubKey.toByteArray()));
                tx.addOutput(new TransactionOutput(params, tx, lastOutputValue, new byte[]{OP_1}));
                tx.addInput(new TransactionInput(params, tx, new byte[]{OP_1}, lastOutPoint));
                lastOutPoint = new TransactionOutPoint(params, 1, tx.getHash());
               
View Full Code Here

Examples of com.google.bitcoin.core.Coin

    private Block createNextBlock(Block baseBlock, int nextBlockHeight, @Nullable TransactionOutPointWithValue prevOut,
            Coin additionalCoinbaseValue) throws ScriptException {
        Integer height = blockToHeightMap.get(baseBlock.getHash());
        if (height != null)
            checkState(height == nextBlockHeight - 1);
        Coin coinbaseValue = FIFTY_COINS.shiftRight(nextBlockHeight / params.getSubsidyDecreaseBlockCount())
                .add((prevOut != null ? prevOut.value.subtract(SATOSHI) : ZERO))
                .add(additionalCoinbaseValue == null ? ZERO : additionalCoinbaseValue);
        Block block = baseBlock.createNextBlockWithCoinbase(coinbaseOutKeyPubKey, coinbaseValue);
        if (prevOut != null) {
            Transaction t = new Transaction(params);
View Full Code Here

Examples of entities.Coin

        updateList.add(e);
        new Thread(e).start();
      }
      else if (entity[0] == 3) {
        // Initialisieren eines großen Gegners
        Coin e = new Coin();
        e.getHitbox().newX = entity[1] * tm.getTilesizeX();
        e.getHitbox().newY = entity[2] * tm.getTilesizeY() - e.getHitbox().height;
        updateList.add(e);
        new Thread(e).start();
      }
      else if (entity[0] == 4) {
        // Initialisieren eines großen Gegners
        Finish e = new Finish();
        e.getHitbox().newX = entity[1] * tm.getTilesizeX();
        e.getHitbox().newY = entity[2] * tm.getTilesizeY() - e.getHitbox().height;
        updateList.add(e);
        new Thread(e).start();
      }
  }
View Full Code Here

Examples of org.bitcoinj.core.Coin

        // Copy data from model.
        addressEdit.setText(model.address.get());
        titleEdit.setText(model.title.get());
        descriptionEdit.setText(model.memo.get());
        Coin goalCoin = Coin.valueOf(model.goalAmount.get());
        if (goalCoin.value != 1) {  // 1 satoshi is sentinel value meaning new project.
            goalAmountEdit.setText(goalCoin.toPlainString());
        }
        minPledgeEdit.setPromptText(model.getMinPledgeAmount().toPlainString());
        if (model.image.get() == null) {
            setupDefaultCoverImage();
        } else {
            InputStream stream = model.image.get().newInput();
            coverImageView.setImage(new Image(stream));
            uncheck(stream::close);
        }

        // Bind UI back to model.
        this.model.title.bind(titleEdit.textProperty());
        this.model.memo.bind(descriptionEdit.textProperty());
        this.model.address.bind(addressEdit.textProperty());

        coverPhotoSiteLink.setText(COVERPHOTO_SITE);

        ValidationLink goalValid = new ValidationLink(goalAmountEdit, str -> !LHUtils.didThrow(() -> valueOrThrow(str)));
        goalAmountEdit.textProperty().addListener((obj, prev, cur) -> {
            if (goalValid.isValid.get())
                this.model.goalAmount.set(valueOrThrow(cur).value);
        });
        // Figure out the smallest pledge that is allowed based on the goal divided by number of inputs we can have.
        model.minPledgeAmountProperty().addListener(o -> {
            minPledgeEdit.setPromptText(model.getMinPledgeAmount().toPlainString());
        });
        ValidationLink minPledgeValue = new ValidationLink(minPledgeEdit, str -> {
            if (str.isEmpty())
                return true// default is used
            Coin coin = valueOrNull(str);
            if (coin == null) return false;
            Coin amount = model.getMinPledgeAmount();
            // If min pledge == suggested amount it's ok, or if it's between min amount and goal.
            return coin.equals(amount) || (coin.isGreaterThan(amount) && coin.isLessThan(Coin.valueOf(this.model.goalAmount.get())));
        });

        ValidationLink.autoDisableButton(nextButton,
View Full Code Here

Examples of org.bitcoinj.core.Coin

    public void initialize() {
        ValidationLink amountLink = new ValidationLink(amountEdit, str -> {
            // Can't pledge more than our balance or more than the project is trying to actually raise
            // as excess would go to miners fees.
            Coin coin = valueOrNull(str);
            boolean valid = coin != null && coin.compareTo(max) <= 0 && coin.compareTo(min) >= 0;
            minersFeeLabel.setVisible(valid && !coin.equals(Main.wallet.getBalance()));
            return valid;
        });
        ValidationLink emailLink = new ValidationLink(emailEdit, str -> str.contains("@"));
        ValidationLink.autoDisableButton(confirmButton, amountLink, emailLink);
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.