diff --git a/wallet/openassets.go b/wallet/openassets.go index 887b659..2012725 100644 --- a/wallet/openassets.go +++ b/wallet/openassets.go @@ -93,7 +93,6 @@ func (w *Wallet) processOpenAssetTransaction(tx *wire.MsgTx) { // Register the new asset txHash := tx.TxHash() oatxo.AssetID = btcutil.Hash160(txHash[:]) - w.registerAsset(OpenAsset{ AssetID: oatxo.AssetID, Follow: oatxo.Ours, diff --git a/wallet/wallet.go b/wallet/wallet.go index 7898d7f..93ef7cd 100644 --- a/wallet/wallet.go +++ b/wallet/wallet.go @@ -21,7 +21,7 @@ type Wallet struct { config *config.Config utxos []Utxo assetUtxos []OpenAssetUtxo - assets []OpenAsset + assets []*OpenAsset privateKey *btcec.PrivateKey pubKey *btcec.PublicKey pubKeyHash [20]byte @@ -86,7 +86,7 @@ func (w *Wallet) AssetBalance(assetID []byte) uint64 { return value } -func (w *Wallet) Assets() []OpenAsset { +func (w *Wallet) Assets() []*OpenAsset { return w.assets } @@ -155,7 +155,7 @@ func (w *Wallet) registerAssetUtxo(utxo OpenAssetUtxo) { } func (w *Wallet) registerAsset(asset OpenAsset) { - w.assets = append(w.assets, asset) + w.assets = append(w.assets, &asset) } func (w *Wallet) FindUtxoFromTxIn(txi *wire.TxIn) (Utxo, error) {