|
|
|
@ -132,11 +132,15 @@ func (u *PayoutsProcessor) process() { |
|
|
|
for _, login := range payees { |
|
|
|
for _, login := range payees { |
|
|
|
amount, _ := u.backend.GetBalance(login) |
|
|
|
amount, _ := u.backend.GetBalance(login) |
|
|
|
amountInShannon := big.NewInt(amount) |
|
|
|
amountInShannon := big.NewInt(amount) |
|
|
|
|
|
|
|
ptresh, _ := u.backend.GetTreshold(login) |
|
|
|
|
|
|
|
if ptresh <= 10 { |
|
|
|
|
|
|
|
ptresh = u.config.Threshold |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
// Shannon^2 = Wei
|
|
|
|
// Shannon^2 = Wei
|
|
|
|
amountInWei := new(big.Int).Mul(amountInShannon, util.Shannon) |
|
|
|
amountInWei := new(big.Int).Mul(amountInShannon, util.Shannon) |
|
|
|
|
|
|
|
|
|
|
|
if !u.reachedThreshold(amountInShannon) { |
|
|
|
if !u.reachedThreshold(amountInShannon, ptresh) { |
|
|
|
continue |
|
|
|
continue |
|
|
|
} |
|
|
|
} |
|
|
|
mustPay++ |
|
|
|
mustPay++ |
|
|
|
@ -285,8 +289,8 @@ func (self PayoutsProcessor) checkPeers() bool { |
|
|
|
return true |
|
|
|
return true |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
func (self PayoutsProcessor) reachedThreshold(amount *big.Int) bool { |
|
|
|
func (self PayoutsProcessor) reachedThreshold(amount *big.Int, threshold int64) bool { |
|
|
|
return big.NewInt(self.config.Threshold).Cmp(amount) < 0 |
|
|
|
return big.NewInt(threshold).Cmp(amount) < 0 |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
func formatPendingPayments(list []*storage.PendingPayment) string { |
|
|
|
func formatPendingPayments(list []*storage.PendingPayment) string { |
|
|
|
|