add condition during delete self recipient key

Signed-off-by: Hasan Mohammad Shahriar <mshahriar.h@gmail.com>
This commit is contained in:
Hasan Mohammad Shahriar 2022-11-18 06:59:21 +00:00 committed by Ry Jones
parent 7c42ff3d8e
commit 07091cf6bf

View file

@ -1001,8 +1001,8 @@ func removeBalance(ctx contractapi.TransactionContextInterface, sender string, i
}
}
} else {
// Delete self recipient key
} else if selfRecipientKeyNeedsToBeRemoved {
// Delete self recipient key if required
err = ctx.GetStub().DelState(selfRecipientKey)
if err != nil {
return fmt.Errorf("failed to delete the state of %v: %v", selfRecipientKey, err)