Commit c6e47999 authored by jiangpeng's avatar jiangpeng Committed by vipwzw

dapp/privacy:remove unnecessary error log(#950)

parent f9e2f57a
This diff is collapsed.
......@@ -1010,14 +1010,26 @@ func (policy *privacyPolicy) buildAndStoreWalletTxDetail(param *buildStoreWallet
}
func (policy *privacyPolicy) checkExpireFTXOOnTimer() {
operater := policy.getWalletOperate()
header := operater.GetLastHeader()
header := policy.getWalletOperate().GetLastHeader()
if header == nil {
bizlog.Error("checkExpireFTXOOnTimer Can not get last header.")
return
}
policy.store.moveFTXO2UTXOWhenFTXOExpire(header.Height, header.BlockTime)
curFTXOTxs, keys := policy.store.getFTXOlist()
if len(curFTXOTxs) == 0 {
return
}
dbbatch := policy.store.NewBatch(true)
for i, ftxo := range curFTXOTxs {
if !ftxo.IsExpire(header.GetHeight(), header.GetBlockTime()) {
continue
}
policy.store.moveFTXO2UTXO(keys[i], dbbatch)
bizlog.Debug("moveFTXO2UTXOWhenFTXOExpire", "moveFTXO2UTXO key", string(keys[i]), "expire ftxo", ftxo)
}
err := dbbatch.Write()
if err != nil {
bizlog.Error("checkExpireFTXOOnTimer", "db write err", err)
}
}
func (policy *privacyPolicy) checkWalletStoreData() {
......
......@@ -963,16 +963,3 @@ func (store *privacyStore) moveSTXO2FTXO(tx *types.Transaction, txhash string, n
newbatch.Write()
return nil
}
func (store *privacyStore) moveFTXO2UTXOWhenFTXOExpire(blockheight, blocktime int64) {
dbbatch := store.NewBatch(true)
curFTXOTxs, keys := store.getFTXOlist()
for i, ftxo := range curFTXOTxs {
if !ftxo.IsExpire(blockheight, blocktime) {
continue
}
store.moveFTXO2UTXO(keys[i], dbbatch)
bizlog.Debug("moveFTXO2UTXOWhenFTXOExpire", "moveFTXO2UTXO key", string(keys[i]), "ftxo.IsExpire", ftxo.IsExpire(blockheight, blocktime))
}
dbbatch.Write()
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment