Exemplo n.º 1
0
        public ITransaction Build(uint ver, List <UTXO> txToSpend, List <ReceivingAddress> receiveAddr, uint lockTime)
        {
            TxIn[] tIns = txToSpend.Select(x => new TxIn()
            {
                Outpoint = new Outpoint()
                {
                    Index = x.OutIndex, TxHash = Base16.ToByteArray(Base16.Reverse(x.TxHash))
                },
                SigScript = new SignatureScript(),
                Sequence  = uint.MaxValue
            }).ToArray();

            TxOut[] tOuts = receiveAddr.Select(x => new TxOut()
            {
                Amount    = x.PaymentSatoshi,
                PubScript = BuildPubkeyScript(x.Address)
            }).ToArray();

            Transaction tx = new Transaction((int)ver, tIns, tOuts, lockTime);

            return(tx);
        }