Ejemplo n.º 1
0
        public override Script GenerateScriptSig(Script scriptPubKey, IKeyRepository keyRepo, ISigner signer)
        {
            var offer = SolverScriptBuilder.ExtractOfferScriptParameters(scriptPubKey);
            var key   = keyRepo.FindKey(offer.FulfillKey.ScriptPubKey) ?? keyRepo.FindKey(offer.RedeemKey.ScriptPubKey);

            if (key == null)
            {
                return(null);
            }
            var sig = signer.Sign(key);

            return(new Script(Op.GetPushOp(sig.ToBytes())));
        }
Ejemplo n.º 2
0
        public override int EstimateScriptSigSize(Script scriptPubKey)
        {
            var offer = SolverScriptBuilder.ExtractOfferScriptParameters(scriptPubKey);

            return(DummySignature.ToBytes().Length + offer.Hashes.Length * (int)SolutionKey.KeySize);
        }
Ejemplo n.º 3
0
 public override bool CanGenerateScriptSig(Script scriptPubKey)
 {
     return(SolverScriptBuilder.ExtractOfferScriptParameters(scriptPubKey) != null);
 }