func (inv *Inventory) handleTransaction(tx *messages.Transaction) { if !tx.MatchesFilter(inv.filter.Filter()) { log.Printf("Received transaction %x not matching the filter.", tx.Hash()) } else { log.Printf("Received transaction %x matching the filter: %x", tx.Hash(), tx.Data()) } inv.addTxData(tx.Hash(), tx) w := inv.config.Wallet if w != nil { if w.HasNewAddressesToWatch() { // A wallet has had its address space expand and we // need to add these new addresses to the filter and // unless we're certain this is a fresh transaction (as // opposed to a historic one), we need to rescan // history. for _, o := range w.WatchObjects() { inv.filter.Watch(o, filterMayNeedUpdate) } // TODO Decide whether or not to rescan history. This // can be done easily (but slowely) by setting height // back to 0. } } }