From f9963cca377d2789bbb09eef5a58e9a564ab4241 Mon Sep 17 00:00:00 2001 From: Roman Khimov Date: Tue, 4 Feb 2020 18:58:40 +0300 Subject: [PATCH] core: short-circuit verifyInputs when there are no inputs --- pkg/core/mempool/mem_pool.go | 3 +++ 1 file changed, 3 insertions(+) diff --git a/pkg/core/mempool/mem_pool.go b/pkg/core/mempool/mem_pool.go index 07ef64c76..0848b69dc 100644 --- a/pkg/core/mempool/mem_pool.go +++ b/pkg/core/mempool/mem_pool.go @@ -306,6 +306,9 @@ func (mp *Pool) GetVerifiedTransactions() []*transaction.Transaction { // verifyInputs is an internal unprotected version of Verify. func (mp *Pool) verifyInputs(tx *transaction.Transaction) bool { + if len(tx.Inputs) == 0 { + return true + } for _, item := range mp.unsortedTxn { for i := range item.txn.Inputs { for j := 0; j < len(tx.Inputs); j++ {