From a3feadbcf0dd66293eab0a0e2864789a2bcdfc05 Mon Sep 17 00:00:00 2001 From: Alexis Hernandez Date: Sat, 19 Jan 2019 19:13:43 -0700 Subject: [PATCH] server: The Transaction now requires that its outputs belong to it --- server/app/com/xsn/explorer/models/Transaction.scala | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/server/app/com/xsn/explorer/models/Transaction.scala b/server/app/com/xsn/explorer/models/Transaction.scala index 06d720c..7d1d515 100644 --- a/server/app/com/xsn/explorer/models/Transaction.scala +++ b/server/app/com/xsn/explorer/models/Transaction.scala @@ -6,7 +6,13 @@ case class Transaction( time: Long, size: Size, inputs: List[Transaction.Input], - outputs: List[Transaction.Output]) + outputs: List[Transaction.Output]) { + + require( + outputs.forall(_.txid == id), + "There are outputs that having a different txid" + ) +} object Transaction {