From 23dca5edfd2f152fcc2f638553ecee4ebb3a5d41 Mon Sep 17 00:00:00 2001 From: Josh Rickmar Date: Fri, 13 Jun 2014 16:17:15 -0500 Subject: [PATCH] Fix bug returning unconfirmed txstore records. The incorrect slice was being appended to, causing some unconfirmedg records to be dropped from the return result. --- txstore/tx.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/txstore/tx.go b/txstore/tx.go index c2e9447..a6bd8c7 100644 --- a/txstore/tx.go +++ b/txstore/tx.go @@ -1322,10 +1322,10 @@ func (s *Store) Records() (records []*TxRecord) { // Unconfirmed records are saved unsorted, and must be sorted by // received date on the fly. - unconfirmed := make([]*TxRecord, len(s.unconfirmed.txs)) + unconfirmed := make([]*TxRecord, 0, len(s.unconfirmed.txs)) for _, r := range s.unconfirmed.txs { key := BlockTxKey{BlockHeight: -1} - unconfirmed = append(records, &TxRecord{key, r, s}) + unconfirmed = append(unconfirmed, &TxRecord{key, r, s}) } sort.Sort(byReceiveDate(unconfirmed)) records = append(records, unconfirmed...)