From 4fd8cb7c60838433c59480f61ba6dbb0b4f655ad Mon Sep 17 00:00:00 2001 From: Sarlor Date: Fri, 8 Feb 2019 15:30:15 +0800 Subject: [PATCH] blockchain: Optimize skip stakebase input. This optimizes to check the traversal position first since it is more likely in deserializeSpendJournalEntry func. --- blockchain/chainio.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/blockchain/chainio.go b/blockchain/chainio.go index 16439a57..ed40f40e 100644 --- a/blockchain/chainio.go +++ b/blockchain/chainio.go @@ -680,7 +680,7 @@ func deserializeSpendJournalEntry(serialized []byte, txns []*wire.MsgTx) ([]spen // the associated stxo. for txInIdx := len(tx.TxIn) - 1; txInIdx > -1; txInIdx-- { // Skip stakebase since it has no input. - if isVote && txInIdx == 0 { + if txInIdx == 0 && isVote { continue }