Merge PR #4831: Prevent community spend proposal from transferring funds to a ModuleAcc
This commit is contained in:
parent
99371010f8
commit
cbc802cb78
|
@ -0,0 +1 @@
|
||||||
|
#4831 Prevent community spend proposal from transferring funds to a module account
|
|
@ -9,6 +9,10 @@ import (
|
||||||
|
|
||||||
// HandleCommunityPoolSpendProposal is a handler for executing a passed community spend proposal
|
// HandleCommunityPoolSpendProposal is a handler for executing a passed community spend proposal
|
||||||
func HandleCommunityPoolSpendProposal(ctx sdk.Context, k Keeper, p types.CommunityPoolSpendProposal) sdk.Error {
|
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)
|
err := k.DistributeFromFeePool(ctx, p.Amount, p.Recipient)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return err
|
return err
|
||||||
|
|
Loading…
Reference in New Issue