/**
  * @param TransactionInterface $tx
  * @param ScriptInterface $scriptPubKey
  * @param int $nInputToSign
  * @return bool
  */
 public function verify(TransactionInterface $tx, ScriptInterface $scriptPubKey, $nInputToSign)
 {
     $inputs = $tx->getInputs();
     $interpreter = new Interpreter($this->adapter, $tx, $this->flags);
     return $interpreter->verify($inputs[$nInputToSign]->getScript(), $scriptPubKey, $nInputToSign);
 }
 /**
  * @param TransactionInterface $tx
  * @param ScriptInterface $scriptPubKey
  * @param int $nInputToSign
  * @param int $amount
  * @param ScriptWitnessInterface|null $witness
  * @return bool
  */
 public function verify(TransactionInterface $tx, ScriptInterface $scriptPubKey, $nInputToSign, $amount, ScriptWitnessInterface $witness = null)
 {
     $inputs = $tx->getInputs();
     $interpreter = new Interpreter($this->adapter);
     return $interpreter->verify($inputs[$nInputToSign]->getScript(), $scriptPubKey, $this->flags, new Checker($this->adapter, $tx, $nInputToSign, $amount), $witness);
 }