wip tx hashing

This commit is contained in:
William Banfield
2022-03-11 12:40:48 -05:00
parent 4d8e81a1f5
commit 8765d1e506

View File

@@ -266,20 +266,20 @@ func (rpp *ResponsePrepareProposal) Validate(maxSizeBytes int64, otxs [][]byte)
}
}
if _, ok := ntx[string(tr.Tx)]; ok {
return errors.New("TxRecords contains duplicate transaction")
return errors.New("TxRecords contains duplicate transaction, transaction hash: %x")
}
ntx[string(tr.Tx)] = struct{}{}
if _, ok := otxsSet[string(tr.Tx)]; ok {
if tr.Action == TxRecord_ADDED {
return fmt.Errorf("unmodified transaction incorrectly marked as %s", tr.Action.String())
return fmt.Errorf("unmodified transaction incorrectly marked as %s, transaction hash: %x", tr.Action.String())
}
} else {
if tr.Action == TxRecord_REMOVED || tr.Action == TxRecord_UNMODIFIED {
return fmt.Errorf("unmodified transaction incorrectly marked as %s", tr.Action.String())
return fmt.Errorf("unmodified transaction incorrectly marked as %s, transaction hash: %x", tr.Action.String())
}
}
if tr.Action == TxRecord_UNKNOWN {
return fmt.Errorf("transaction incorrectly marked as %s", tr.Action.String())
return fmt.Errorf("transaction incorrectly marked as %s, transaction hash: %x", tr.Action.String())
}
}
return nil