2023-01-23 10:31:54 -08:00
|
|
|
// Copyright (c) 2020-2023 The Zcash developers
|
2020-06-05 14:46:45 -07:00
|
|
|
// Distributed under the MIT software license, see the accompanying
|
|
|
|
// file COPYING or https://www.opensource.org/licenses/mit-license.php .
|
|
|
|
|
|
|
|
#ifndef ZCASH_CONSENSUS_FUNDING_H
|
|
|
|
#define ZCASH_CONSENSUS_FUNDING_H
|
|
|
|
|
|
|
|
#include <amount.h>
|
|
|
|
#include <consensus/params.h>
|
|
|
|
|
|
|
|
|
|
|
|
namespace Consensus
|
|
|
|
{
|
|
|
|
|
|
|
|
struct FSInfo {
|
2020-08-20 06:48:01 -07:00
|
|
|
const char* recipient;
|
|
|
|
const char* specification;
|
2020-06-05 14:46:45 -07:00
|
|
|
uint64_t valueNumerator;
|
|
|
|
uint64_t valueDenominator;
|
|
|
|
|
2020-08-20 09:46:57 -07:00
|
|
|
/**
|
|
|
|
* Returns the inherent value of this funding stream.
|
|
|
|
*
|
|
|
|
* For the active funding streams at a given height, use
|
|
|
|
* GetActiveFundingStreams() or GetActiveFundingStreamElements().
|
|
|
|
*/
|
2020-06-05 14:46:45 -07:00
|
|
|
CAmount Value(CAmount blockSubsidy) const;
|
|
|
|
};
|
|
|
|
|
|
|
|
extern const struct FSInfo FundingStreamInfo[];
|
|
|
|
|
2020-07-02 11:15:26 -07:00
|
|
|
typedef std::pair<FundingStreamAddress, CAmount> FundingStreamElement;
|
2020-06-05 14:46:45 -07:00
|
|
|
|
2020-07-02 11:15:26 -07:00
|
|
|
std::set<FundingStreamElement> GetActiveFundingStreamElements(
|
2020-06-05 14:46:45 -07:00
|
|
|
int nHeight,
|
|
|
|
CAmount blockSubsidy,
|
|
|
|
const Consensus::Params& params);
|
2020-07-09 10:25:27 -07:00
|
|
|
|
|
|
|
std::vector<FSInfo> GetActiveFundingStreams(
|
|
|
|
int nHeight,
|
|
|
|
const Consensus::Params& params);
|
|
|
|
|
2020-06-05 14:46:45 -07:00
|
|
|
} // namespace Consensus
|
|
|
|
|
|
|
|
#endif // ZCASH_CONSENSUS_FUNDING_H
|