mirror of
https://github.com/hyperledger/fabric-samples.git
synced 2026-06-23 01:55:10 +00:00
add condition during delete self recipient key
Signed-off-by: Hasan Mohammad Shahriar <mshahriar.h@gmail.com>
This commit is contained in:
parent
7c42ff3d8e
commit
07091cf6bf
1 changed files with 2 additions and 2 deletions
|
|
@ -1001,8 +1001,8 @@ func removeBalance(ctx contractapi.TransactionContextInterface, sender string, i
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
} else {
|
} else if selfRecipientKeyNeedsToBeRemoved {
|
||||||
// Delete self recipient key
|
// Delete self recipient key if required
|
||||||
err = ctx.GetStub().DelState(selfRecipientKey)
|
err = ctx.GetStub().DelState(selfRecipientKey)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return fmt.Errorf("failed to delete the state of %v: %v", selfRecipientKey, err)
|
return fmt.Errorf("failed to delete the state of %v: %v", selfRecipientKey, err)
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue