From 4148a01a5ad394e29998baae55f4fcbfaaf8c309 Mon Sep 17 00:00:00 2001 From: chadlagore Date: Sat, 17 Jun 2017 16:28:41 -0700 Subject: [PATCH] refactor --- pool/pool.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pool/pool.go b/pool/pool.go index 1b52bc3..279a627 100644 --- a/pool/pool.go +++ b/pool/pool.go @@ -43,8 +43,8 @@ func (p *Pool) GetN(N int) *blockchain.Transaction { // GetIndex returns the index of the transaction in the ordering. func (p *Pool) GetIndex(t *blockchain.Transaction) int { - return getIndex(p.Order, p.ValidTransactions[t.Input.Hash].Time, - 0, p.Len()-1) + target := p.ValidTransactions[t.Input.Hash].Time + return getIndex(p.Order, target, 0, p.Len()-1) } // getIndex does a binary search for a PooledTransaction by timestamp.