Skip to content

Commit

Permalink
add height in burning
Browse files Browse the repository at this point in the history
  • Loading branch information
dragonheaven committed Feb 17, 2021
1 parent dea759b commit 511914f
Showing 1 changed file with 10 additions and 5 deletions.
15 changes: 10 additions & 5 deletions node/sync.go
Original file line number Diff line number Diff line change
Expand Up @@ -1014,11 +1014,15 @@ func (d *Pegnetd) applyTransactionBatch(sqlTx *sql.Tx, txBatch *fat2.Transaction
// recordBatch will submit the batch to the database. We assume the tx is 100%
// valid at this point.
func (d *Pegnetd) recordBatch(sqlTx *sql.Tx, txBatch *fat2.TransactionBatch, rates map[fat2.PTicker]uint64, currentHeight uint32) error {
FAGlobalBurnAddress, err := factom.NewFAAddress(GlobalBurnAddress)
if err != nil {
log.WithFields(log.Fields{
"error": err,
}).Info("error getting burn address")
var FAGlobalBurnAddress factom.FAAddress
var err error
if currentHeight >= V202EnhanceActivation {
FAGlobalBurnAddress, err = factom.NewFAAddress(GlobalBurnAddress)
if err != nil {
log.WithFields(log.Fields{
"error": err,
}).Info("error getting burn address")
}
}

for txIndex, tx := range txBatch.Transactions {
Expand Down Expand Up @@ -1377,6 +1381,7 @@ func (d *Pegnetd) GetAssetRatesV0(oprWinners []opr.AssetUint, sprWinners []opr.A
toleranceBandLow := float64(sprRate) * (1 - toleranceRate)
if (float64(oprRate) >= toleranceBandLow) && (float64(oprRate) <= toleranceBandHigh) {
filteredRates = append(filteredRates, oprWinners[i])

} else {
return nil, fmt.Errorf("opr is out side of tolerance band")
}
Expand Down

0 comments on commit 511914f

Please sign in to comment.