Skip to content

Conversation

iFoggz
Copy link
Member

@iFoggz iFoggz commented Jul 31, 2018

Addresses #1213 For raining on all magnitudes on the network.

Add optional message as well.

Opted to keep this contained in the RPC function rather then forming for executeRain.

Tested on testnet with success.
Note: Tx Fee is not taken into account with the amount specified as the fee is calculated after the transaction is made. I don't see a need to estimate and calculate that before hand.

rainbymagnitude 100018:14:42
{
"Rain By Magnitude": "Sent",
"TXID": "8e06e0afb13460e972f5f08c5a03eb41ed789783d608a92611ef816523c3fd29",
"Rain Amount Sent": 1000,
"TX Fee": 0.0002,
"# of Recipients": 29
}

18:19:15
rainbymagnitude 3880 "Does this suffice Jim"18:19:16
{
"Rain By Magnitude": "Sent",
"TXID": "c035dec2f6c84a45e5960c7ef28ae95504b56acce791a7254e229955bb55be90",
"Rain Amount Sent": 3879.9998,
"TX Fee": 0.0002,
"# of Recipients": 29,
"Message": "Does this suffice Jim"
}

@denravonska denravonska added this to the Camilla milestone Aug 1, 2018
@denravonska
Copy link
Member

Can you make a project rain as well?

std::string sContract = DecodeBase64(scacheContract);
std::string sGRCAddress = ExtractValue(sContract, ";", 2);

double dPayout = Round(((dMagnitude / dTotalNetworkMagnitude) * dAmount), 4);
Copy link
Member

@denravonska denravonska Aug 16, 2018

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Skip this recipient if the payment would be 0?

This will also cause the total payment to become less than the specified. Or the rounding causes it to be more. Maybe we shouldn't round at all.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I like the idea of no rounding. and yes 0 magnitude should be ignored.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

gonna eliminate the round and also if they have 0 mag its already skipped

// Use total network magnitude here as using 115000 can results in a lower then intended sent amount due to a missing project
double dTotalNetworkMagnitude = structcpid.NetworkMagnitude;

for (unsigned int i = 0; i < vSuperblock.size(); i++)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Instead of going through the superblock you can check mvMagnitudes which should contain the same information.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

will do tmr

@denravonska denravonska merged commit 7a9b892 into gridcoin-community:development Sep 10, 2018
@denravonska denravonska deleted the rainbymagnituderpc branch September 10, 2018 15:04
denravonska added a commit that referenced this pull request Apr 3, 2019
Added:
 - Add `rainbymagnitude` RPC command #1235 (@Foggyx420).
 - Add stake splitting and side staking #1265 (@jamescowens).
 - Detect and block Windows shutdown so wallet can exit cleanly #1309
   (@jamescowens).
 - Add message support to sendfrom and sendtoaddress #1400 (@denravonska).

Changed:
 - Configuration options are now case insensitive #294 (@Foggyx420).
 - Update command in beaconstatus help message #1312 (@chrstphrchvz).
 - Improve synchronization speeds:
   - Refactor superblock pack/unpack #1194 (@denravonska).
   - Optimize neuralsecurity calculations #1255 (@denravonska).
   - Reduce hash calculations when checking blocks #1206 (@denravonska).
 - Make display of private key in beaconstatus OPT-IN only #1275 (@Foggyx420).
 - Store Beacon keys in Wallet #1088 (@tomasbrod).
 - Use default colors for pie chart #1333 (@chrstphrchvz).
 - Show hand cursor when hovering clickable labels #1332 (@chrstphrchvz).
 - Update README.md #1337 (@Peppernrino).
 - Fix integer overflow with displayed nonce #1297 (@personthingman2).
 - Improve application cache performance #1317 (@denravonska).
 - Improve reorg speeds #1263 (@denravonska).
 - Update Polish translation #1375 (@michalkania).

Fixed:
 - Remove expired polls from overview page #1250 (@personthingman2).
 - Fix plural text on block age #1304 (@scribblemaniac).
 - Fix researcher staking issue if your chain head was staked by you,
   #1299 (@denravonska).
 - Fix incorrect address to grcpool node #1314 (@wilkart).
 - Do not replace underscores by spaces in Qt Poll URLs #1327 (@tomasbrod).
 - Fix scraper SSL issues #1330 (@Foggyx420).

Removed:
 - Remove or merged several RPC commands #1228 (@Foggyx420):
    - `newburnaddress`, removed.
    - `burn2`: Removed.
    - `cpid`: Merged into `projects`.
    - `mymagnitude`: Merged into `magnitude`.
    - `rsa`: Removed, use `magnitude`.
    - `rsaweight`: Removed, use `magnitude`.
    - `proveownership`: Removed.
    - `encrypt`: Removed.
 - Remove obsolete POW fields from RPC responses #1358 (@jamescowens).
 - Remove obsolete netsoft fields for slight RAM requirement reduction
   #1336 (@denravonska).
 - Remove unused attachment functionality #1345 (@denravonska).
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants