Merge PR #4831: Prevent community spend proposal from transferring funds to a ModuleAcc

This commit is contained in:
Federico Kunze 2019-08-02 14:29:00 +02:00 committed by Alexander Bezobchuk
parent 99371010f8
commit cbc802cb78
2 changed files with 5 additions and 0 deletions

View File

@ -0,0 +1 @@
#4831 Prevent community spend proposal from transferring funds to a module account

View File

@ -9,6 +9,10 @@ import (
// HandleCommunityPoolSpendProposal is a handler for executing a passed community spend proposal
func HandleCommunityPoolSpendProposal(ctx sdk.Context, k Keeper, p types.CommunityPoolSpendProposal) sdk.Error {
if k.blacklistedAddrs[p.Recipient.String()] {
return sdk.ErrUnauthorized(fmt.Sprintf("%s is blacklisted from receiving external funds", p.Recipient))
}
err := k.DistributeFromFeePool(ctx, p.Amount, p.Recipient)
if err != nil {
return err