From 063fe5be9dd6b22e8ad32bfdab07bd16468f6744 Mon Sep 17 00:00:00 2001 From: Vsevolod Brekelov Date: Mon, 21 Oct 2019 12:40:11 +0300 Subject: [PATCH] unspentcoinstate: fix branch never executed --- pkg/core/unspent_coin_state.go | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/pkg/core/unspent_coin_state.go b/pkg/core/unspent_coin_state.go index ab9cabfaa..a7b566fd8 100644 --- a/pkg/core/unspent_coin_state.go +++ b/pkg/core/unspent_coin_state.go @@ -122,15 +122,14 @@ func IsDoubleSpend(s storage.Store, tx *transaction.Transaction) bool { if r.Err != nil { return false } - if unspent == nil { - return true - } for _, input := range inputs { if int(input.PrevIndex) >= len(unspent.states) || unspent.states[input.PrevIndex] == CoinStateSpent { return true } } + } else { + return true } }