From ebd61e4b486ca758b1307d5a175f469b8e138cb5 Mon Sep 17 00:00:00 2001 From: Michael FIG Date: Fri, 24 May 2019 23:16:32 -0700 Subject: [PATCH] fix: prefix the GetMailbox Has check --- x/swingset/keeper.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/x/swingset/keeper.go b/x/swingset/keeper.go index 7be5744763e..762cadf5043 100644 --- a/x/swingset/keeper.go +++ b/x/swingset/keeper.go @@ -28,10 +28,10 @@ func NewKeeper(coinKeeper bank.Keeper, storeKey sdk.StoreKey, cdc *codec.Codec) // Gets the entire mailbox struct for a peer func (k Keeper) GetMailbox(ctx sdk.Context, peer string) Mailbox { store := ctx.KVStore(k.storeKey) - if !store.Has([]byte(peer)) { + path := "data:mailbox." + peer + if !store.Has([]byte(path)) { return NewMailbox() } - path := "data:mailbox." + peer bz := store.Get([]byte(path)) var mailbox Mailbox k.cdc.MustUnmarshalBinaryBare(bz, &mailbox)