Java Code Examples for org.bitcoinj.core.Transaction#SigHash
The following examples show how to use
org.bitcoinj.core.Transaction#SigHash .
You can vote up the ones you like or vote down the ones you don't like,
and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: TransactionSignature.java From bcm-android with GNU General Public License v3.0 | 5 votes |
/** * Calculates the byte used in the protocol to represent the combination of mode and anyoneCanPay. */ public static int calcSigHashValue(Transaction.SigHash mode, boolean anyoneCanPay) { Preconditions.checkArgument(SigHash.ALL == mode || SigHash.NONE == mode || SigHash.SINGLE == mode); // enforce compatibility since this code was made before the SigHash enum was updated int sighashFlags = mode.value; if (anyoneCanPay) sighashFlags |= Transaction.SigHash.ANYONECANPAY.value; return sighashFlags; }
Example 2
Source File: TransactionSignature.java From bcm-android with GNU General Public License v3.0 | 5 votes |
public Transaction.SigHash sigHashMode() { final int mode = sighashFlags & 0x1f; if (mode == Transaction.SigHash.NONE.value) return Transaction.SigHash.NONE; else if (mode == Transaction.SigHash.SINGLE.value) return Transaction.SigHash.SINGLE; else return Transaction.SigHash.ALL; }
Example 3
Source File: TransactionSignature.java From green_android with GNU General Public License v3.0 | 5 votes |
/** Calculates the byte used in the protocol to represent the combination of mode and anyoneCanPay. */ public static int calcSigHashValue(Transaction.SigHash mode, boolean anyoneCanPay) { Preconditions.checkArgument(SigHash.ALL == mode || SigHash.NONE == mode || SigHash.SINGLE == mode); // enforce compatibility since this code was made before the SigHash enum was updated int sighashFlags = mode.value; if (anyoneCanPay) sighashFlags |= Transaction.SigHash.ANYONECANPAY.value; return sighashFlags; }
Example 4
Source File: TransactionSignature.java From green_android with GNU General Public License v3.0 | 5 votes |
public Transaction.SigHash sigHashMode() { final int mode = sighashFlags & 0x1f; if (mode == Transaction.SigHash.NONE.value) return Transaction.SigHash.NONE; else if (mode == Transaction.SigHash.SINGLE.value) return Transaction.SigHash.SINGLE; else return Transaction.SigHash.ALL; }
Example 5
Source File: TransactionSignature.java From GreenBits with GNU General Public License v3.0 | 5 votes |
/** Calculates the byte used in the protocol to represent the combination of mode and anyoneCanPay. */ public static int calcSigHashValue(Transaction.SigHash mode, boolean anyoneCanPay) { Preconditions.checkArgument(SigHash.ALL == mode || SigHash.NONE == mode || SigHash.SINGLE == mode); // enforce compatibility since this code was made before the SigHash enum was updated int sighashFlags = mode.value; if (anyoneCanPay) sighashFlags |= Transaction.SigHash.ANYONECANPAY.value; return sighashFlags; }
Example 6
Source File: TransactionSignature.java From GreenBits with GNU General Public License v3.0 | 5 votes |
public Transaction.SigHash sigHashMode() { final int mode = sighashFlags & 0x1f; if (mode == Transaction.SigHash.NONE.value) return Transaction.SigHash.NONE; else if (mode == Transaction.SigHash.SINGLE.value) return Transaction.SigHash.SINGLE; else return Transaction.SigHash.ALL; }
Example 7
Source File: TransactionSignature.java From bcm-android with GNU General Public License v3.0 | 4 votes |
/** * Constructs a transaction signature based on the ECDSA signature. */ public TransactionSignature(ECKey.ECDSASignature signature, Transaction.SigHash mode, boolean anyoneCanPay) { super(signature.r, signature.s); sighashFlags = calcSigHashValue(mode, anyoneCanPay); }
Example 8
Source File: TransactionSignature.java From green_android with GNU General Public License v3.0 | 4 votes |
/** Constructs a transaction signature based on the ECDSA signature. */ public TransactionSignature(ECKey.ECDSASignature signature, Transaction.SigHash mode, boolean anyoneCanPay) { super(signature.r, signature.s); sighashFlags = calcSigHashValue(mode, anyoneCanPay); }
Example 9
Source File: TransactionSignature.java From GreenBits with GNU General Public License v3.0 | 4 votes |
/** Constructs a transaction signature based on the ECDSA signature. */ public TransactionSignature(ECKey.ECDSASignature signature, Transaction.SigHash mode, boolean anyoneCanPay) { super(signature.r, signature.s); sighashFlags = calcSigHashValue(mode, anyoneCanPay); }