From c8844abd62943e91189835e59e3ada8e29a09aaf Mon Sep 17 00:00:00 2001 From: William Banfield Date: Mon, 14 Mar 2022 17:29:51 -0400 Subject: [PATCH] create separate removed list in kvstore --- abci/example/kvstore/kvstore.go | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/abci/example/kvstore/kvstore.go b/abci/example/kvstore/kvstore.go index a3c48e181..6b98d54bb 100644 --- a/abci/example/kvstore/kvstore.go +++ b/abci/example/kvstore/kvstore.go @@ -436,9 +436,10 @@ func (app *Application) execPrepareTx(tx []byte) *types.ExecTxResult { // Tendermint will remove them from its mempool. func (app *Application) substPrepareTx(blockData [][]byte) []*types.TxRecord { trs := make([]*types.TxRecord, len(blockData)) + var removed []*types.TxRecord for i, tx := range blockData { if isPrepareTx(tx) { - trs = append(trs, &types.TxRecord{ + removed = append(removed, &types.TxRecord{ Tx: tx, Action: types.TxRecord_REMOVED, }) @@ -454,5 +455,5 @@ func (app *Application) substPrepareTx(blockData [][]byte) []*types.TxRecord { } } - return trs + return append(trs, removed...) }