@@ -912,21 +912,46 @@ unsigned int GetCoinstakeOutputLimit(const int& block_version)
912
912
}
913
913
914
914
Fraction FoundationSideStakeAllocation () {
915
- // stub
916
-
917
915
// TODO: implement protocol section based override with default value as below.
918
916
919
- return Fraction (1 , 20 );
917
+ if (fTestNet ) {
918
+ std::vector<std::string> fraction = split (gArgs .GetArg (" -foundationsidestakeallocation" , " 4/5" ), " /" );
919
+
920
+ int64_t numerator = 0 ;
921
+ int64_t denominator = 0 ;
922
+
923
+ if (fraction.size () == 2
924
+ && ParseInt64 (fraction[0 ], &numerator)
925
+ && ParseInt64 (fraction[1 ], &denominator)
926
+ && numerator > 0
927
+ && denominator > 0 ) {
928
+ return Fraction (numerator, denominator);
929
+ }
930
+ }
931
+
932
+ // Will get here if either not on testnet OR on testnet and there is no valid foundationsidestakeallocation.
933
+ return Fraction (4 , 5 );
920
934
}
921
935
922
936
CBitcoinAddress FoundationSideStakeAddress () {
923
- // stub
924
-
925
937
// TODO: implement protocol section based override with default value as below.
926
938
927
- CBitcoinAddress foundation_address (gArgs .GetArg (" -foundationaddress" ," bc3NA8e8E3EoTL1qhRmeprbjWcmuoZ26A2" ));
939
+ CBitcoinAddress foundation_address;
940
+
941
+ // If on testnet and not overridden, set foundation destination address to test wallet address
942
+ if (fTestNet ) {
943
+ if (!foundation_address.SetString (gArgs .GetArg (" -foundationaddress" ," mfiy9sc2QEZZCK3WMUMZjNfrdRA6gXzRhr" ))) {
944
+ foundation_address.SetString (" mfiy9sc2QEZZCK3WMUMZjNfrdRA6gXzRhr" );
945
+ }
946
+
947
+ return foundation_address;
948
+ }
949
+
950
+ // Will get here if not on testnet.
951
+ foundation_address.SetString (" bc3NA8e8E3EoTL1qhRmeprbjWcmuoZ26A2" );
928
952
929
953
return foundation_address;
954
+ ;
930
955
}
931
956
932
957
unsigned int GetMRCOutputLimit (const int & block_version, bool include_foundation_sidestake)
0 commit comments