public PrunedException(Sha256Hash hash) { super(hash.toString()); this.hash = hash; } public Sha256Hash getHash() {
public PrunedException(Sha256Hash hash) { super(hash.toString()); this.hash = hash; } public Sha256Hash getHash() {
public PrunedException(Sha256Hash hash) { super(hash.toString()); this.hash = hash; } public Sha256Hash getHash() {
public PrunedException(Sha256Hash hash) { super(hash.toString()); this.hash = hash; } public Sha256Hash getHash() {
@Override public void serialize(Sha256Hash value, JsonGenerator gen, SerializerProvider serializers) throws IOException, JsonProcessingException { gen.writeString(value.toString()); } }
/** * Returns the hash of the block (which for a valid, solved block should be below the target) in the form seen on * the block explorer. If you call this on block 1 in the mainnet chain * you will get "00000000839a8e6886ab5951d76f411475428afc90947ee320161bbf18eb6048". */ public String getHashAsString() { return getHash().toString(); }
/** * Returns the hash of the block (which for a valid, solved block should be below the target) in the form seen on * the block explorer. If you call this on block 1 in the mainnet chain * you will get "00000000839a8e6886ab5951d76f411475428afc90947ee320161bbf18eb6048". */ public String getHashAsString() { return getHash().toString(); }
/** * Returns the transaction hash (aka txid) as you see them in block explorers, as a hex string. */ public String getHashAsString() { return getHash().toString(); }
/** * Returns the hash of the block (which for a valid, solved block should be below the target) in the form seen on * the block explorer. If you call this on block 1 in the mainnet chain * you will get "00000000839a8e6886ab5951d76f411475428afc90947ee320161bbf18eb6048". */ public String getHashAsString() { return getHash().toString(); }
@Override public String getHashAsString() { return getHash().toString(); }
/** * Returns the hash of the block (which for a valid, solved block should be below the target) in the form seen on * the block explorer. If you call this on block 1 in the mainnet chain * you will get "00000000839a8e6886ab5951d76f411475428afc90947ee320161bbf18eb6048". */ public String getHashAsString() { return getHash().toString(); }
public Optional<PaymentRequestData> getPaymentRequestDataByHash(String transactionHashAsString) { for (PaymentRequestData paymentRequestData : bip70PaymentRequestDataMap.values()) { if (paymentRequestData.getTransactionHash().isPresent() && paymentRequestData.getTransactionHash().get().toString().equals(transactionHashAsString)) { return Optional.of(paymentRequestData); } } return Optional.absent(); }
void createEmptyTxLockCandidate(Sha256Hash txHash) { if(mapTxLockCandidates.containsKey(txHash)) return; log.info("CInstantSend::CreateEmptyTxLockCandidate -- new, txid=%s"+ txHash.toString()); TransactionLockRequest txLockRequest = null; mapTxLockCandidates.put(txHash, new TransactionLockCandidate(context.getParams(), txLockRequest)); }
private int findSigInRedeem(byte[] signatureBytes, Sha256Hash hash) { checkArgument(chunks.get(0).isOpCode()); // P2SH scriptSig int numKeys = Script.decodeFromOpN(chunks.get(chunks.size() - 2).opcode); TransactionSignature signature = TransactionSignature.decodeFromBitcoin(signatureBytes, true); for (int i = 0 ; i < numKeys ; i++) { if (ECKey.fromPublicOnly(chunks.get(i + 1).data).verify(hash, signature)) { return i; } } throw new IllegalStateException("Could not find matching key for signature on " + hash.toString() + " sig " + Utils.HEX.encode(signatureBytes)); }
private int findSigInRedeem(byte[] signatureBytes, Sha256Hash hash) { checkArgument(chunks.get(0).isOpCode()); // P2SH scriptSig int numKeys = Script.decodeFromOpN(chunks.get(chunks.size() - 2).opcode); TransactionSignature signature = TransactionSignature.decodeFromBitcoin(signatureBytes, true); for (int i = 0 ; i < numKeys ; i++) { if (ECKey.fromPublicOnly(chunks.get(i + 1).data).verify(hash, signature)) { return i; } } throw new IllegalStateException("Could not find matching key for signature on " + hash.toString() + " sig " + Utils.HEX.encode(signatureBytes)); }
private int findSigInRedeem(byte[] signatureBytes, Sha256Hash hash) { checkArgument(chunks.get(0).isOpCode()); // P2SH scriptSig int numKeys = Script.decodeFromOpN(chunks.get(chunks.size() - 2).opcode); TransactionSignature signature = TransactionSignature.decodeFromBitcoin(signatureBytes, true); for (int i = 0 ; i < numKeys ; i++) { if (ECKey.fromPublicOnly(chunks.get(i + 1).data).verify(hash, signature)) { return i; } } throw new IllegalStateException("Could not find matching key for signature on " + hash.toString() + " sig " + Utils.HEX.encode(signatureBytes)); }
private int findSigInRedeem(byte[] signatureBytes, Sha256Hash hash) { checkArgument(chunks.get(0).isOpCode()); // P2SH scriptSig int numKeys = Script.decodeFromOpN(chunks.get(chunks.size() - 2).opcode); TransactionSignature signature = TransactionSignature.decodeFromBitcoin(signatureBytes, true); for (int i = 0 ; i < numKeys ; i++) { if (ECKey.fromPublicOnly(chunks.get(i + 1).data).verify(hash, signature)) { return i; } } throw new IllegalStateException("Could not find matching key for signature on " + hash.toString() + " sig " + HEX.encode(signatureBytes)); }
@Override public void onSuccess(ResultMessage result) { try { String txId = result.getResult().getString(0); // FIXME could return {u'message': u'', u'code': -25} log.info("got tx {} =?= {}", txId, tx.getHash()); checkState(tx.getHash().toString().equals(txId)); if (listener != null) listener.onTransactionBroadcast(tx); } catch (Exception e) { onFailure(e); } }
@Override public Transaction getTransaction (Sha256Hash hash) { try { Transaction transaction = blockExplorer.getBitcoinJTransaction(hash.toString()); double height = blockExplorer.getTransaction(hash.toString()).getBlockHeight(); if (height > 0) { transaction.getConfidence().setDepthInBlocks((int) (blockChain.getChainHead().getHeight() - height)); } return transaction; } catch (Exception e) { throw new RuntimeException(e); } }
@Override public void onSuccess(ResultMessage result) { try { String txId = result.getResult().getString(0); // FIXME could return {u'message': u'', u'code': -25} log.info("got tx {} =?= {}", txId, tx.getHash()); checkState(tx.getHash().toString().equals(txId)); if (listener != null) listener.onTransactionBroadcast(tx); } catch (Exception e) { onFailure(e); } }