1 | <?php |
||
14 | class Hasher extends SigHash |
||
15 | { |
||
16 | /** |
||
17 | * @var TransactionSerializerInterface |
||
18 | */ |
||
19 | private $txSerializer; |
||
20 | |||
21 | /** |
||
22 | * Hasher constructor. |
||
23 | * @param TransactionInterface $transaction |
||
24 | * @param TransactionSerializerInterface|null $txSerializer |
||
25 | */ |
||
26 | 86 | public function __construct(TransactionInterface $transaction, TransactionSerializerInterface $txSerializer = null) |
|
31 | |||
32 | /** |
||
33 | * Calculate the hash of the current transaction, when you are looking to |
||
34 | * spend $txOut, and are signing $inputToSign. The SigHashType defaults to |
||
35 | * SIGHASH_ALL, though SIGHASH_SINGLE, SIGHASH_NONE, SIGHASH_ANYONECANPAY |
||
36 | * can be used. |
||
37 | * |
||
38 | * @param ScriptInterface $txOutScript |
||
39 | * @param int $inputToSign |
||
40 | * @param int $sighashType |
||
41 | * @return BufferInterface |
||
42 | * @throws \Exception |
||
43 | */ |
||
44 | 86 | public function calculate(ScriptInterface $txOutScript, $inputToSign, $sighashType = SigHash::ALL) |
|
61 | } |
||
62 |