[Nod-25] Add payload hash to wire transaction (#200)

* [NOD-25] Intermediate commit

* [NOD-25] Fixed tests crashes

* [NOD-25] Fixed tests

* [NOD-25] Removed temporary debug code

* [NOD-25] Fixed error message
This commit is contained in:
Evgeny Khirin
2019-03-12 10:48:57 +02:00
committed by Svarog
parent ae92cb06ea
commit b4f50f4e48
22 changed files with 168 additions and 48 deletions

View File

@@ -257,10 +257,14 @@ func shallowCopyTx(tx *wire.MsgTx) wire.MsgTx {
// pointers into the contiguous arrays. This avoids a lot of small
// allocations.
txCopy := wire.MsgTx{
Version: tx.Version,
TxIn: make([]*wire.TxIn, len(tx.TxIn)),
TxOut: make([]*wire.TxOut, len(tx.TxOut)),
LockTime: tx.LockTime,
Version: tx.Version,
TxIn: make([]*wire.TxIn, len(tx.TxIn)),
TxOut: make([]*wire.TxOut, len(tx.TxOut)),
LockTime: tx.LockTime,
SubnetworkID: tx.SubnetworkID,
Gas: tx.Gas,
PayloadHash: tx.PayloadHash,
Payload: tx.Payload,
}
txIns := make([]wire.TxIn, len(tx.TxIn))
for i, oldTxIn := range tx.TxIn {