OSDN Git Service

add SetStandardUTXO
authorChengcheng Zhang <943420582@qq.com>
Tue, 2 Jul 2019 14:57:14 +0000 (22:57 +0800)
committerChengcheng Zhang <943420582@qq.com>
Tue, 2 Jul 2019 14:57:14 +0000 (22:57 +0800)
account/accounts.go
wallet/utxo.go

index 98c6c2c..95f8261 100644 (file)
@@ -658,3 +658,7 @@ func (m *Manager) SaveControlPrograms(progs ...*CtrlProgram) error {
        }
        return nil
 }
+
+func (m *Manager) SetStandardUTXO(outputID bc.Hash, utxo *UTXO) error {
+       return m.store.SetStandardUTXO(outputID, utxo)
+}
index cd3819b..ce79461 100644 (file)
@@ -146,7 +146,7 @@ func (w *Wallet) filterAccountUtxo(utxos []*account.UTXO) []*account.UTXO {
 func (w *Wallet) saveUtxos(utxos []*account.UTXO) error {
        for _, utxo := range utxos {
                if segwit.IsP2WScript(utxo.ControlProgram) {
-                       if err := w.store.SetStandardUTXO(utxo.OutputID, utxo); err != nil {
+                       if err := w.AccountMgr.SetStandardUTXO(utxo.OutputID, utxo); err != nil {
                                return err
                        }
                } else {