"encoding/json"
log "github.com/sirupsen/logrus"
- "github.com/tendermint/tmlibs/db"
-
- "github.com/bytom/account"
- "github.com/bytom/consensus"
- "github.com/bytom/consensus/segwit"
- "github.com/bytom/crypto/sha3pool"
- "github.com/bytom/errors"
- "github.com/bytom/protocol/bc"
- "github.com/bytom/protocol/bc/types"
+
+ "github.com/bytom/bytom/account"
+ "github.com/bytom/bytom/consensus"
+ "github.com/bytom/bytom/consensus/segwit"
+ "github.com/bytom/bytom/crypto/sha3pool"
+ "github.com/bytom/bytom/errors"
+ "github.com/bytom/bytom/protocol/bc"
+ "github.com/bytom/bytom/protocol/bc/types"
+ dbm "github.com/bytom/bytom/database/leveldb"
)
// GetAccountUtxos return all account unspent outputs
return accountUtxos
}
-func (w *Wallet) attachUtxos(batch db.Batch, b *types.Block, txStatus *bc.TransactionStatus) {
+func (w *Wallet) attachUtxos(batch dbm.Batch, b *types.Block, txStatus *bc.TransactionStatus) {
for txIndex, tx := range b.Transactions {
statusFail, err := txStatus.GetStatus(txIndex)
if err != nil {
}
}
-func (w *Wallet) detachUtxos(batch db.Batch, b *types.Block, txStatus *bc.TransactionStatus) {
+func (w *Wallet) detachUtxos(batch dbm.Batch, b *types.Block, txStatus *bc.TransactionStatus) {
for txIndex := len(b.Transactions) - 1; txIndex >= 0; txIndex-- {
tx := b.Transactions[txIndex]
for j := range tx.Outputs {
return result
}
-func batchSaveUtxos(utxos []*account.UTXO, batch db.Batch) error {
+func batchSaveUtxos(utxos []*account.UTXO, batch dbm.Batch) error {
for _, utxo := range utxos {
data, err := json.Marshal(utxo)
if err != nil {