Skip to content

Commit

Permalink
blockchain: Use new expenditure policy if activated.
Browse files Browse the repository at this point in the history
This switches the blockchain to use the maximum treasury expenditure
policy defined in DCP0007 if the corresponding vote is approved in the
chain.
  • Loading branch information
matheusd authored and davecgh committed Aug 25, 2021
1 parent fbde3b7 commit f117708
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions blockchain/treasury.go
Original file line number Diff line number Diff line change
Expand Up @@ -789,6 +789,13 @@ func (b *BlockChain) maxTreasuryExpenditureDCP0007(preTVINode *blockNode) (int64
//
// The passed node MUST correspond to a node immediately prior to a TVI block.
func (b *BlockChain) maxTreasuryExpenditure(preTVINode *blockNode) (int64, error) {
isRevertPolicyActive, err := b.isRevertTreasuryPolicyActive(preTVINode)
if err != nil {
return 0, err
}
if isRevertPolicyActive {
return b.maxTreasuryExpenditureDCP0007(preTVINode)
}
return b.maxTreasuryExpenditureDCP0006(preTVINode)
}

Expand Down

0 comments on commit f117708

Please sign in to comment.