From c2bbe114b5d13fbb06da2e50a9dbae5f44e29c7d Mon Sep 17 00:00:00 2001 From: David Hill Date: Fri, 28 Jul 2017 10:15:57 -0400 Subject: [PATCH] blockchain: check for error --- blockchain/validate.go | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/blockchain/validate.go b/blockchain/validate.go index 28ff1ff4..c243e1bc 100644 --- a/blockchain/validate.go +++ b/blockchain/validate.go @@ -1603,7 +1603,12 @@ func CheckTransactionInputs(subsidyCache *SubsidyCache, tx *dcrutil.Tx, txHeight // Inputs won't exist for stakebase tx, so ignore them. if isSSGen && idx == 0 { // However, do add the reward amount. - _, heightVotingOn, _ := stake.SSGenBlockVotedOn(msgTx) + _, heightVotingOn, err := stake.SSGenBlockVotedOn(msgTx) + if err != nil { + errStr := fmt.Sprintf("unexpected vote tx "+ + "decode error: %v", err) + return 0, ruleError(ErrUnparseableSSGen, errStr) + } stakeVoteSubsidy := CalcStakeVoteSubsidy(subsidyCache, int64(heightVotingOn), chainParams) totalAtomIn += stakeVoteSubsidy