Skip to content

Commit

Permalink
Merge pull request #6 from smartholdem/v2.0
Browse files Browse the repository at this point in the history
version
  • Loading branch information
technologiespro authored Sep 28, 2020
2 parents e8288dd + 77738ec commit ebeeb00
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 5 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,3 +11,4 @@ v.2
- shell script update
- crypto sig on auth
- support 2n passphrase
- skip delegate vote
9 changes: 9 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,17 @@ Recalculation of rewards occurs every 30 minutes.

## Install

stable version
```
git clone https://github.com/smartholdem/rewarder.git
```

or latest version
```
git clone -b v2.0 https://github.com/smartholdem/rewarder.git
```

```
cd rewarder
npm install
```
Expand Down
12 changes: 7 additions & 5 deletions routes/v2/api.js
Original file line number Diff line number Diff line change
Expand Up @@ -252,11 +252,13 @@ class Reward {
//if (delegate.roundForged > voters.length * 2) {
for (let i = 0; i < voters.length; i++) {
if (voters[i].waitPay > 1) {
preparedTxs.push(await this.prepareTx({
amount: (voters[i].waitPay - 1).toFixed(6), // minus fee 1 STH
memo: config.msg + ' ' + voters[i].percent + '% from ' + forPay + ' STH',
recipient: voters[i].address,
}));
if (delegate.address !== voters[i].address) { //skip delegate address
preparedTxs.push(await this.prepareTx({
amount: (voters[i].waitPay - 1).toFixed(6), // minus fee 1 STH
memo: config.msg + ' ' + voters[i].percent + '% from ' + forPay + ' STH',
recipient: voters[i].address,
}));
}
voters[i].totalPay = (voters[i].totalPay + voters[i].waitPay).toFixed(2) * 1;
voters[i].waitPay = 0;
await db.put('1x' + voters[i].address, voters[i]);
Expand Down

0 comments on commit ebeeb00

Please sign in to comment.