From 2ecb22a89d8d17a1ad7e0f355b3066f64328a4a8 Mon Sep 17 00:00:00 2001 From: Jason Yellick Date: Sat, 18 Feb 2017 15:56:56 -0500 Subject: [PATCH] [FAB-2359] Fix Broken Master https://jira.hyperledger.org/browse/FAB-2359 The introduction of the TxID checks on configuration transactions has broken master. This should be addressed more directly, but it is causing all CI to fail. This makes the checks only apply to endorser transactions. Change-Id: I1c6c7536f83e42f0281d18f8d7b147dcb243175a Signed-off-by: Jason Yellick --- core/common/validation/msgvalidation.go | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/core/common/validation/msgvalidation.go b/core/common/validation/msgvalidation.go index 2bbc79d4977..24d2f16e8aa 100644 --- a/core/common/validation/msgvalidation.go +++ b/core/common/validation/msgvalidation.go @@ -371,20 +371,20 @@ func ValidateTransaction(e *common.Envelope) (*common.Payload, error) { // TODO: ensure that creator can transact with us (some ACLs?) which set of APIs is supposed to give us this info? - // Verify that the transaction ID has been computed properly. - // This check is needed to ensure that the lookup into the ledger - // for the same TxID catches duplicates. - err = utils.CheckProposalTxID( - payload.Header.ChannelHeader.TxId, - payload.Header.SignatureHeader.Nonce, - payload.Header.SignatureHeader.Creator) - if err != nil { - return nil, err - } - // continue the validation in a way that depends on the type specified in the header switch common.HeaderType(payload.Header.ChannelHeader.Type) { case common.HeaderType_ENDORSER_TRANSACTION: + // Verify that the transaction ID has been computed properly. + // This check is needed to ensure that the lookup into the ledger + // for the same TxID catches duplicates. + err = utils.CheckProposalTxID( + payload.Header.ChannelHeader.TxId, + payload.Header.SignatureHeader.Nonce, + payload.Header.SignatureHeader.Creator) + if err != nil { + return nil, err + } + err = validateEndorserTransaction(payload.Data, payload.Header) putilsLogger.Infof("ValidateTransactionEnvelope returns err %s", err) return payload, err