@@ -624,8 +624,8 @@ func parseAssetWitness(input AssetWitness) (asset.Witness, error) {
624624// dbAssetsToChainAssets maps a set of confirmed assets in the database, and
625625// the witnesses of those assets to a set of normal ChainAsset structs needed
626626// by a higher level application.
627- func ( a * AssetStore ) dbAssetsToChainAssets (dbAssets []ConfirmedAsset ,
628- witnesses assetWitnesses ) ([]* asset.ChainAsset , error ) {
627+ func dbAssetsToChainAssets (dbAssets []ConfirmedAsset , witnesses assetWitnesses ,
628+ dbClock clock. Clock ) ([]* asset.ChainAsset , error ) {
629629
630630 chainAssets := make ([]* asset.ChainAsset , len (dbAssets ))
631631 for i := range dbAssets {
@@ -829,7 +829,7 @@ func (a *AssetStore) dbAssetsToChainAssets(dbAssets []ConfirmedAsset,
829829 owner := sprout .AnchorLeaseOwner
830830 expiry := sprout .AnchorLeaseExpiry
831831 if len (owner ) > 0 && expiry .Valid &&
832- expiry .Time .UTC ().After (a . clock .Now ().UTC ()) {
832+ expiry .Time .UTC ().After (dbClock .Now ().UTC ()) {
833833
834834 copy (chainAssets [i ].AnchorLeaseOwner [:], owner )
835835 chainAssets [i ].AnchorLeaseExpiry = & expiry .Time
@@ -1235,7 +1235,7 @@ func (a *AssetStore) FetchAllAssets(ctx context.Context, includeSpent,
12351235 return nil , dbErr
12361236 }
12371237
1238- return a . dbAssetsToChainAssets (dbAssets , assetWitnesses )
1238+ return dbAssetsToChainAssets (dbAssets , assetWitnesses , a . clock )
12391239}
12401240
12411241// FetchManagedUTXOs fetches all UTXOs we manage.
@@ -1947,7 +1947,9 @@ func (a *AssetStore) queryChainAssets(ctx context.Context, q ActiveAssetsStore,
19471947 if err != nil {
19481948 return nil , err
19491949 }
1950- matchingAssets , err := a .dbAssetsToChainAssets (dbAssets , assetWitnesses )
1950+ matchingAssets , err := dbAssetsToChainAssets (
1951+ dbAssets , assetWitnesses , a .clock ,
1952+ )
19511953 if err != nil {
19521954 return nil , err
19531955 }
0 commit comments