Commit c2771f30 authored by Sergei Zubov's avatar Sergei Zubov

Fix decoded transaction model

parent a309dcac
......@@ -75,7 +75,17 @@ namespace Stratis.Bitcoin.Controllers.Models
this.Version = trx.Version;
this.LockTime = trx.LockTime;
this.VIn = trx.Inputs.Select(txin => new Vin(txin.PrevOut, txin.Sequence, txin.ScriptSig)).ToList();
this.VIn = trx.IsCoinBase
? trx.Inputs.Select(txin => new Vin(txin.PrevOut, txin.Sequence, txin.ScriptSig)).ToList()
: trx.Inputs.Select(txin => txin.IsChangePointer()
? new Vin
{
ScriptSig = new Script(txin.ScriptSig),
TxId = txin.PrevOut.Hash.ToString(),
VOut = txin.PrevOut.N,
Sequence = (uint) txin.Sequence
}
: new Vin(txin.PrevOut, txin.Sequence, txin.ScriptSig)).ToList();
int n = 0;
this.VOut = trx.Outputs.Select(txout => new Vout(n++, txout, network)).ToList();
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment