public bool UsesKey(byte[] pubKeyHash) { var lockingHash = WalletCore.PublicKeyHashed(PubKey); //Console.WriteLine("lockin hash "+ Convert.ToBase64String(lockingHash)); //Console.WriteLine("pkHash " + Convert.ToBase64String(pubKeyHash)); return(ArrayHelpers.ByteArrayCompare(lockingHash, pubKeyHash)); }
public bool BelongsToThisChain(Block b) { if (ArrayHelpers.ByteArrayCompare(GetLastBlock().Hash, b.PreviousHash)) { return(true); } return(false); }
public Transaction FindTransaction(byte[] id) { foreach (var block in this) { foreach (var tx in block.Transactions) { if (ArrayHelpers.ByteArrayCompare(tx.Id, id)) { return(tx); } } } return(new Transaction()); }
public override bool Equals(object obj) { if (obj == null) { return(false); } if (GetType() != obj.GetType()) { return(false); } return(ArrayHelpers.ByteArrayCompare(((TxOutput)obj).PublicKeyHash, PublicKeyHash) && Value.Equals(((TxOutput)obj).Value)); }
private bool IsPreviousHashValid(byte[] previousHash) { return(ArrayHelpers.ByteArrayCompare(chain.GetLatestBlock().Hash, previousHash)); }
public bool IsLockedWithKey(byte[] pubKeyHash) { return(ArrayHelpers.ByteArrayCompare(PublicKeyHash, pubKeyHash)); }