blockchain: Optimize skip stakebase input.

This optimizes to check the traversal position first since it is more
likely in deserializeSpendJournalEntry func.
This commit is contained in:
Sarlor 2019-02-08 15:30:15 +08:00 committed by Dave Collins
parent dcd2d701b5
commit 4fd8cb7c60

View File

@ -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
}